sqllogictest
Check-in [9483eb157c]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:More updates for PostgreSQL compatibility.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9483eb157c126abb8e6c6c5d25afa5787926bae2
User & Date: shaneh 2008-12-23 20:29:52
Context
2008-12-24
05:05
Random SQL expressions. No FROM clauses. Passes on SQLite, MySQL, and MSSQL. check-in: 0748319a3a user: shaneh tags: trunk
2008-12-23
20:29
More updates for PostgreSQL compatibility. check-in: 9483eb157c user: shaneh tags: trunk
04:48
Updated to skip tests for PostgreSQL where output column is (re)named without an AS term. check-in: 9b5974b19a user: shaneh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/random/aggregates/slt_good_0.test.

23374
23375
23376
23377
23378
23379
23380

23381
23382
23383
23384
23385
23386
23387
.....
32689
32690
32691
32692
32693
32694
32695

32696
32697
32698
32699
32700
32701
32702
onlyif mysql # aggregate syntax: 
query I rowsort label-2573
SELECT - + 52 / - COUNT( * ) * - - ( + SUM( ALL - + col0 ) ) AS col2 FROM tab0 WHERE NULL <> - 41
----
NULL

skipif mysql # not compatible

query I rowsort label-2573
SELECT - + 52 / - COUNT ( * ) * - - ( + SUM ( ALL - + col0 ) ) AS col2 FROM tab0 WHERE NULL <> - 41
----
NULL

query III rowsort
SELECT * FROM tab2 AS cor0 WHERE col0 BETWEEN NULL AND + 56 * + + col2 * col1
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3594
SELECT col0 / col1 AS col2, + 78 * 68 / - 0 AS col2 FROM tab1 AS cor0 WHERE NOT NULL > + col2 + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible

query II rowsort label-3594
SELECT col0 / col1 AS col2, + 78 * 68 / - 0 AS col2 FROM tab1 AS cor0 WHERE NOT NULL > + col2 + CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT + 89 * 34 FROM tab0 AS cor0
----







>







 







>







23374
23375
23376
23377
23378
23379
23380
23381
23382
23383
23384
23385
23386
23387
23388
.....
32690
32691
32692
32693
32694
32695
32696
32697
32698
32699
32700
32701
32702
32703
32704
onlyif mysql # aggregate syntax: 
query I rowsort label-2573
SELECT - + 52 / - COUNT( * ) * - - ( + SUM( ALL - + col0 ) ) AS col2 FROM tab0 WHERE NULL <> - 41
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort label-2573
SELECT - + 52 / - COUNT ( * ) * - - ( + SUM ( ALL - + col0 ) ) AS col2 FROM tab0 WHERE NULL <> - 41
----
NULL

query III rowsort
SELECT * FROM tab2 AS cor0 WHERE col0 BETWEEN NULL AND + 56 * + + col2 * col1
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3594
SELECT col0 / col1 AS col2, + 78 * 68 / - 0 AS col2 FROM tab1 AS cor0 WHERE NOT NULL > + col2 + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query II rowsort label-3594
SELECT col0 / col1 AS col2, + 78 * 68 / - 0 AS col2 FROM tab1 AS cor0 WHERE NOT NULL > + col2 + CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT + 89 * 34 FROM tab0 AS cor0
----

Changes to test/random/aggregates/slt_good_102.test.

8280
8281
8282
8283
8284
8285
8286

8287
8288
8289
8290
8291
8292
8293
.....
12184
12185
12186
12187
12188
12189
12190

12191
12192
12193
12194
12195
12196
12197
.....
22782
22783
22784
22785
22786
22787
22788

22789
22790
22791
22792
22793
22794
22795
query I rowsort
SELECT - 33 col1 FROM tab2 cor0
----
-33
-33
-33


query I rowsort
SELECT + col2 FROM tab0 AS cor0 WHERE NOT col1 * col2 * - + 86 * - 70 * - - 93 * - + col2 / + 33 > col0 + - col0
----
10
47
99

................................................................................
onlyif mysql # aggregate syntax: 
query I rowsort label-1319
SELECT + COUNT( * ) / + COUNT( * ) * + MAX( + col0 ) AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NULL
----
NULL

skipif mysql # not compatible

query I rowsort label-1319
SELECT + COUNT ( * ) / + COUNT ( * ) * + MAX ( + col0 ) AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NULL
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-1320
................................................................................
SELECT DISTINCT + col2 * + col2 * - col2 * col2 * + col2 DIV + col2 + col0 AS col2 FROM tab0
----
-4879666
-96059504
-9913

skipif mysql # not compatible

query I rowsort label-2475
SELECT DISTINCT + col2 * + col2 * - col2 * col2 * + col2 / + col2 + col0 AS col2 FROM tab0
----
-4879666
-96059504
-9913








>







 







>







 







>







8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
.....
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
.....
22784
22785
22786
22787
22788
22789
22790
22791
22792
22793
22794
22795
22796
22797
22798
query I rowsort
SELECT - 33 col1 FROM tab2 cor0
----
-33
-33
-33

skipif postgresql # PostgreSQL does not promote INTEGER (32-bit) results
query I rowsort
SELECT + col2 FROM tab0 AS cor0 WHERE NOT col1 * col2 * - + 86 * - 70 * - - 93 * - + col2 / + 33 > col0 + - col0
----
10
47
99

................................................................................
onlyif mysql # aggregate syntax: 
query I rowsort label-1319
SELECT + COUNT( * ) / + COUNT( * ) * + MAX( + col0 ) AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NULL
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort label-1319
SELECT + COUNT ( * ) / + COUNT ( * ) * + MAX ( + col0 ) AS col2 FROM tab2 AS cor0 WHERE NOT NULL IS NULL
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-1320
................................................................................
SELECT DISTINCT + col2 * + col2 * - col2 * col2 * + col2 DIV + col2 + col0 AS col2 FROM tab0
----
-4879666
-96059504
-9913

skipif mysql # not compatible
skipif postgresql # PostgreSQL does not promote INTEGER (32-bit) results
query I rowsort label-2475
SELECT DISTINCT + col2 * + col2 * - col2 * col2 * + col2 / + col2 + col0 AS col2 FROM tab0
----
-4879666
-96059504
-9913

Changes to test/random/aggregates/slt_good_103.test.

54268
54269
54270
54271
54272
54273
54274

54275
54276
54277
54278
54279
54280
54281
skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5968
SELECT DISTINCT 34 / ( + col2 / CAST ( NULL AS INTEGER ) ) - 7 / 93 col2 FROM tab1
----
NULL


query I rowsort
SELECT ALL + 28 FROM tab1 WHERE NULL BETWEEN ( 58 / - 0 + - col2 ) AND NULL
----

query I rowsort
SELECT DISTINCT col1 + col2 * - col0 AS col1 FROM tab2
----







>







54268
54269
54270
54271
54272
54273
54274
54275
54276
54277
54278
54279
54280
54281
54282
skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5968
SELECT DISTINCT 34 / ( + col2 / CAST ( NULL AS INTEGER ) ) - 7 / 93 col2 FROM tab1
----
NULL

skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort
SELECT ALL + 28 FROM tab1 WHERE NULL BETWEEN ( 58 / - 0 + - col2 ) AND NULL
----

query I rowsort
SELECT DISTINCT col1 + col2 * - col0 AS col1 FROM tab2
----

Changes to test/random/aggregates/slt_good_106.test.

9296
9297
9298
9299
9300
9301
9302

9303
9304
9305
9306
9307
9308
9309
4288
5025

query III rowsort
SELECT ALL * FROM tab2 WHERE NOT - + col2 NOT BETWEEN NULL AND col2
----


query I rowsort
SELECT DISTINCT 40 + + 78 / - 0 FROM tab0 WHERE NOT NULL IS NULL
----

query I rowsort
SELECT + ( + 62 ) * - col2 * - col2 + + + col1 FROM tab1
----







>







9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
4288
5025

query III rowsort
SELECT ALL * FROM tab2 WHERE NOT - + col2 NOT BETWEEN NULL AND col2
----

skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort
SELECT DISTINCT 40 + + 78 / - 0 FROM tab0 WHERE NOT NULL IS NULL
----

query I rowsort
SELECT + ( + 62 ) * - col2 * - col2 + + + col1 FROM tab1
----

Changes to test/random/aggregates/slt_good_108.test.

19558
19559
19560
19561
19562
19563
19564

19565
19566
19567
19568
19569
19570
19571
skipif mysql # not compatible
query II rowsort label-2112
SELECT ALL + MIN ( - 78 ) AS col1, + COUNT ( * ) AS col2 FROM tab2 AS cor0
----
-78
3


query I rowsort
SELECT 50 / + + 0 AS col2 FROM tab0 cor0 WHERE + 79 <= NULL
----

query I rowsort
SELECT - - 3 + - + col0 + 61 - col1 + - col1 * 95 FROM tab1 AS cor0
----







>







19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
skipif mysql # not compatible
query II rowsort label-2112
SELECT ALL + MIN ( - 78 ) AS col1, + COUNT ( * ) AS col2 FROM tab2 AS cor0
----
-78
3

skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort
SELECT 50 / + + 0 AS col2 FROM tab0 cor0 WHERE + 79 <= NULL
----

query I rowsort
SELECT - - 3 + - + col0 + 61 - col1 + - col1 * 95 FROM tab1 AS cor0
----

Changes to test/random/aggregates/slt_good_11.test.

38385
38386
38387
38388
38389
38390
38391

38392
38393
38394
38395
38396
38397
38398
onlyif mysql # aggregate syntax: 
query I rowsort label-4186
SELECT DISTINCT - ( - + 95 ) + - COUNT( * ) AS col0 FROM tab1 WHERE NOT + col1 / - 26 * col0 + 58 / + 0 / - col2 - + col1 < NULL
----
95

skipif mysql # not compatible

query I rowsort label-4186
SELECT DISTINCT - ( - + 95 ) + - COUNT ( * ) AS col0 FROM tab1 WHERE NOT + col1 / - 26 * col0 + 58 / + 0 / - col2 - + col1 < NULL
----
95

query I rowsort
SELECT DISTINCT col1 * + col2 + + ( + - 65 ) * + col0 AS col2 FROM tab1







>







38385
38386
38387
38388
38389
38390
38391
38392
38393
38394
38395
38396
38397
38398
38399
onlyif mysql # aggregate syntax: 
query I rowsort label-4186
SELECT DISTINCT - ( - + 95 ) + - COUNT( * ) AS col0 FROM tab1 WHERE NOT + col1 / - 26 * col0 + 58 / + 0 / - col2 - + col1 < NULL
----
95

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort label-4186
SELECT DISTINCT - ( - + 95 ) + - COUNT ( * ) AS col0 FROM tab1 WHERE NOT + col1 / - 26 * col0 + 58 / + 0 / - col2 - + col1 < NULL
----
95

query I rowsort
SELECT DISTINCT col1 * + col2 + + ( + - 65 ) * + col0 AS col2 FROM tab1

Changes to test/random/aggregates/slt_good_112.test.

33882
33883
33884
33885
33886
33887
33888

33889
33890
33891
33892
33893
33894
33895
.....
85031
85032
85033
85034
85035
85036
85037

85038
85039
85040
85041
85042
85043
85044
SELECT col2 * + + col0 * col2 * col0 * + - col2 DIV - + col2 AS col0 FROM tab0 AS cor0
----
497025
756900
92217609

skipif mysql # not compatible

query I rowsort label-3738
SELECT col2 * + + col0 * col2 * col0 * + - col2 / - + col2 AS col0 FROM tab0 AS cor0
----
497025
756900
92217609

................................................................................
onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-9346
SELECT DISTINCT 95 / + COUNT( * ) * - CAST( MIN( ALL - col0 ) AS SIGNED ) AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL
----
NULL

skipif mysql # not compatible

query I rowsort label-9346
SELECT DISTINCT 95 / + COUNT ( * ) * - CAST ( MIN ( ALL - col0 ) AS INTEGER ) AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL
----
NULL

query III rowsort
SELECT * FROM tab0 AS cor0 WHERE - 0 IS NULL







>







 







>







33882
33883
33884
33885
33886
33887
33888
33889
33890
33891
33892
33893
33894
33895
33896
.....
85032
85033
85034
85035
85036
85037
85038
85039
85040
85041
85042
85043
85044
85045
85046
SELECT col2 * + + col0 * col2 * col0 * + - col2 DIV - + col2 AS col0 FROM tab0 AS cor0
----
497025
756900
92217609

skipif mysql # not compatible
skipif postgresql # PostgreSQL does not promote INTEGER (32-bit) results
query I rowsort label-3738
SELECT col2 * + + col0 * col2 * col0 * + - col2 / - + col2 AS col0 FROM tab0 AS cor0
----
497025
756900
92217609

................................................................................
onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-9346
SELECT DISTINCT 95 / + COUNT( * ) * - CAST( MIN( ALL - col0 ) AS SIGNED ) AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort label-9346
SELECT DISTINCT 95 / + COUNT ( * ) * - CAST ( MIN ( ALL - col0 ) AS INTEGER ) AS col1 FROM tab2 AS cor0 WHERE NOT NULL IS NULL
----
NULL

query III rowsort
SELECT * FROM tab0 AS cor0 WHERE - 0 IS NULL

Changes to test/random/aggregates/slt_good_12.test.

71379
71380
71381
71382
71383
71384
71385

71386
71387
71388
71389
71390
71391
71392

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7694
SELECT - col0 + - col0 + - 50 / + + 0 + - ( 4 ) FROM tab2 WHERE NULL IS NULL AND NOT ( NULL ) <> - 60 * - CAST( NULL AS SIGNED )
----

skipif mysql # not compatible

query I rowsort label-7694
SELECT - col0 + - col0 + - 50 / + + 0 + - ( 4 ) FROM tab2 WHERE NULL IS NULL AND NOT ( NULL ) <> - 60 * - CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT ALL 64 - - - col0 AS col0 FROM tab0
----







>







71379
71380
71381
71382
71383
71384
71385
71386
71387
71388
71389
71390
71391
71392
71393

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7694
SELECT - col0 + - col0 + - 50 / + + 0 + - ( 4 ) FROM tab2 WHERE NULL IS NULL AND NOT ( NULL ) <> - 60 * - CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort label-7694
SELECT - col0 + - col0 + - 50 / + + 0 + - ( 4 ) FROM tab2 WHERE NULL IS NULL AND NOT ( NULL ) <> - 60 * - CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT ALL 64 - - - col0 AS col0 FROM tab0
----

Changes to test/random/aggregates/slt_good_122.test.

67707
67708
67709
67710
67711
67712
67713

67714
67715
67716
67717
67718
67719
67720
onlyif mysql # CAST syntax: SIGNED type: 
query III rowsort label-7426
SELECT ALL * FROM tab0 cor0 WHERE NOT - 66 + + 72 - + col1 + - col2 * + + col0 * - CAST( 93 AS SIGNED ) * + + col2 * - col0 * - col1 / - 15 IS NULL
----
9 values hashing to c4b42765dff94eaaa46040e537fb43b7

skipif mysql # not compatible

query III rowsort label-7426
SELECT ALL * FROM tab0 cor0 WHERE NOT - 66 + + 72 - + col1 + - col2 * + + col0 * - CAST ( 93 AS INTEGER ) * + + col2 * - col0 * - col1 / - 15 IS NULL
----
9 values hashing to c4b42765dff94eaaa46040e537fb43b7

query I rowsort
SELECT - - col2 * + - col2 FROM tab2 cor0







>







67707
67708
67709
67710
67711
67712
67713
67714
67715
67716
67717
67718
67719
67720
67721
onlyif mysql # CAST syntax: SIGNED type: 
query III rowsort label-7426
SELECT ALL * FROM tab0 cor0 WHERE NOT - 66 + + 72 - + col1 + - col2 * + + col0 * - CAST( 93 AS SIGNED ) * + + col2 * - col0 * - col1 / - 15 IS NULL
----
9 values hashing to c4b42765dff94eaaa46040e537fb43b7

skipif mysql # not compatible
skipif postgresql # PostgreSQL does not promote INTEGER (32-bit) results
query III rowsort label-7426
SELECT ALL * FROM tab0 cor0 WHERE NOT - 66 + + 72 - + col1 + - col2 * + + col0 * - CAST ( 93 AS INTEGER ) * + + col2 * - col0 * - col1 / - 15 IS NULL
----
9 values hashing to c4b42765dff94eaaa46040e537fb43b7

query I rowsort
SELECT - - col2 * + - col2 FROM tab2 cor0

Changes to test/random/aggregates/slt_good_123.test.

29671
29672
29673
29674
29675
29676
29677

29678
29679
29680
29681
29682
29683
29684
.....
38168
38169
38170
38171
38172
38173
38174

38175
38176
38177
38178
38179
38180
38181
query I rowsort
SELECT DISTINCT + col2 + + ( - 35 ) AS col1 FROM tab0 cor0
----
-25
12
64


query IIIIII rowsort
SELECT * FROM tab1 AS cor0 CROSS JOIN tab1 AS cor1 WHERE NOT NULL = 38 / 0
----

query II rowsort
SELECT 84 AS col0, + col0 AS col1 FROM tab2
----
................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4077
SELECT ALL - 30 / - 0 * - AVG ( + - CAST( NULL AS SIGNED ) ) FROM tab1
----
NULL

skipif mysql # not compatible

query I rowsort label-4077
SELECT ALL - 30 / - 0 * - AVG ( + - CAST ( NULL AS INTEGER ) ) FROM tab1
----
NULL

query I rowsort
SELECT + + col0 FROM tab2 WHERE NOT NULL > NULL







>







 







>







29671
29672
29673
29674
29675
29676
29677
29678
29679
29680
29681
29682
29683
29684
29685
.....
38169
38170
38171
38172
38173
38174
38175
38176
38177
38178
38179
38180
38181
38182
38183
query I rowsort
SELECT DISTINCT + col2 + + ( - 35 ) AS col1 FROM tab0 cor0
----
-25
12
64

skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query IIIIII rowsort
SELECT * FROM tab1 AS cor0 CROSS JOIN tab1 AS cor1 WHERE NOT NULL = 38 / 0
----

query II rowsort
SELECT 84 AS col0, + col0 AS col1 FROM tab2
----
................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4077
SELECT ALL - 30 / - 0 * - AVG ( + - CAST( NULL AS SIGNED ) ) FROM tab1
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort label-4077
SELECT ALL - 30 / - 0 * - AVG ( + - CAST ( NULL AS INTEGER ) ) FROM tab1
----
NULL

query I rowsort
SELECT + + col0 FROM tab2 WHERE NOT NULL > NULL

Changes to test/random/aggregates/slt_good_25.test.

3067
3068
3069
3070
3071
3072
3073

3074
3075
3076
3077
3078
3079
3080

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-324
SELECT DISTINCT + col2 FROM tab0 AS cor0 WHERE NOT ( + + 14 / + 0 * + 90 - + 84 / + 67 ) < ( NULL ) AND NOT CAST( col2 AS SIGNED ) = NULL
----

skipif mysql # not compatible

query I rowsort label-324
SELECT DISTINCT + col2 FROM tab0 AS cor0 WHERE NOT ( + + 14 / + 0 * + 90 - + 84 / + 67 ) < ( NULL ) AND NOT CAST ( col2 AS INTEGER ) = NULL
----

query I rowsort
SELECT ALL + - 42 * - + 27 * - ( col0 ) AS col1 FROM tab0 AS cor0
----







>







3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-324
SELECT DISTINCT + col2 FROM tab0 AS cor0 WHERE NOT ( + + 14 / + 0 * + 90 - + 84 / + 67 ) < ( NULL ) AND NOT CAST( col2 AS SIGNED ) = NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort label-324
SELECT DISTINCT + col2 FROM tab0 AS cor0 WHERE NOT ( + + 14 / + 0 * + 90 - + 84 / + 67 ) < ( NULL ) AND NOT CAST ( col2 AS INTEGER ) = NULL
----

query I rowsort
SELECT ALL + - 42 * - + 27 * - ( col0 ) AS col1 FROM tab0 AS cor0
----

Changes to test/random/aggregates/slt_good_31.test.

1619
1620
1621
1622
1623
1624
1625

1626
1627
1628
1629
1630
1631
1632

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-178
SELECT ( ( col1 ) ) * + - col1 + - - 85 / - - CAST( 0 AS SIGNED ) - - 13 / ( + 97 ) FROM tab2 WHERE - - 68 IS NULL
----

skipif mysql # not compatible

query I rowsort label-178
SELECT ( ( col1 ) ) * + - col1 + - - 85 / - - CAST ( 0 AS INTEGER ) - - 13 / ( + 97 ) FROM tab2 WHERE - - 68 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-179
SELECT ALL MAX( + col0 ) + + 7 FROM tab0







>







1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-178
SELECT ( ( col1 ) ) * + - col1 + - - 85 / - - CAST( 0 AS SIGNED ) - - 13 / ( + 97 ) FROM tab2 WHERE - - 68 IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort label-178
SELECT ( ( col1 ) ) * + - col1 + - - 85 / - - CAST ( 0 AS INTEGER ) - - 13 / ( + 97 ) FROM tab2 WHERE - - 68 IS NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-179
SELECT ALL MAX( + col0 ) + + 7 FROM tab0

Changes to test/random/aggregates/slt_good_36.test.

89324
89325
89326
89327
89328
89329
89330

89331
89332
89333
89334
89335
89336
89337
onlyif mysql # aggregate syntax: 
query I rowsort label-9867
SELECT ALL COUNT( - col2 ) * + 10 / - + COUNT( * ) * + + SUM( + - col2 ) AS col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL
----
NULL

skipif mysql # not compatible

query I rowsort label-9867
SELECT ALL COUNT ( - col2 ) * + 10 / - + COUNT ( * ) * + + SUM ( + - col2 ) AS col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-9868







>







89324
89325
89326
89327
89328
89329
89330
89331
89332
89333
89334
89335
89336
89337
89338
onlyif mysql # aggregate syntax: 
query I rowsort label-9867
SELECT ALL COUNT( - col2 ) * + 10 / - + COUNT( * ) * + + SUM( + - col2 ) AS col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort label-9867
SELECT ALL COUNT ( - col2 ) * + 10 / - + COUNT ( * ) * + + SUM ( + - col2 ) AS col2 FROM tab2 AS cor0 WHERE NULL IS NOT NULL
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-9868

Changes to test/random/aggregates/slt_good_38.test.

62707
62708
62709
62710
62711
62712
62713

62714
62715
62716
62717
62718
62719
62720

skipif mysql # not compatible
query I rowsort label-6860
SELECT DISTINCT + 13 * + + COUNT ( * ) FROM tab1
----
39


query IIIIII rowsort
SELECT ALL * FROM tab0, tab1 AS cor0 WHERE - + 22 / - 0 NOT BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6862
SELECT COUNT( * ) DIV + + COUNT( * ) col0 FROM tab2







>







62707
62708
62709
62710
62711
62712
62713
62714
62715
62716
62717
62718
62719
62720
62721

skipif mysql # not compatible
query I rowsort label-6860
SELECT DISTINCT + 13 * + + COUNT ( * ) FROM tab1
----
39

skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query IIIIII rowsort
SELECT ALL * FROM tab0, tab1 AS cor0 WHERE - + 22 / - 0 NOT BETWEEN NULL AND NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-6862
SELECT COUNT( * ) DIV + + COUNT( * ) col0 FROM tab2

Changes to test/random/aggregates/slt_good_4.test.

33665
33666
33667
33668
33669
33670
33671

33672
33673
33674
33675
33676
33677
33678
query I rowsort
SELECT DISTINCT - + ( + - col1 ) AS col2 FROM tab0 cor0
----
1
21
81


query II rowsort
SELECT 55 / 0 AS col1, + col1 * col1 * + - col0 AS col2 FROM tab2 cor0 WHERE NOT NULL >= NULL
----

query III rowsort
SELECT * FROM tab0 AS cor0 WHERE NOT col2 BETWEEN NULL AND + + col0
----







>







33665
33666
33667
33668
33669
33670
33671
33672
33673
33674
33675
33676
33677
33678
33679
query I rowsort
SELECT DISTINCT - + ( + - col1 ) AS col2 FROM tab0 cor0
----
1
21
81

skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query II rowsort
SELECT 55 / 0 AS col1, + col1 * col1 * + - col0 AS col2 FROM tab2 cor0 WHERE NOT NULL >= NULL
----

query III rowsort
SELECT * FROM tab0 AS cor0 WHERE NOT col2 BETWEEN NULL AND + + col0
----

Changes to test/random/aggregates/slt_good_43.test.

43022
43023
43024
43025
43026
43027
43028

43029
43030
43031
43032
43033
43034
43035
46
2601
64
5929
75
4489


query II rowsort
SELECT ALL col2 * + + 68 AS col2, - 37 / - 0 AS col2 FROM tab2 WHERE NOT NULL > + col0 OR NULL = ( NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4731
SELECT ALL + COUNT( * ) FROM tab1 WHERE NOT + + col0 > + - 75 + + col1







>







43022
43023
43024
43025
43026
43027
43028
43029
43030
43031
43032
43033
43034
43035
43036
46
2601
64
5929
75
4489

skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query II rowsort
SELECT ALL col2 * + + 68 AS col2, - 37 / - 0 AS col2 FROM tab2 WHERE NOT NULL > + col0 OR NULL = ( NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4731
SELECT ALL + COUNT( * ) FROM tab1 WHERE NOT + + col0 > + - 75 + + col1

Changes to test/random/aggregates/slt_good_46.test.

72924
72925
72926
72927
72928
72929
72930

72931
72932
72933
72934
72935
72936
72937
query I rowsort
SELECT - ( + 90 ) AS col2 FROM tab0
----
-90
-90
-90


query I rowsort
SELECT ALL 0 / 0 AS col2 FROM tab1 AS cor0 WHERE NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT DISTINCT - - col0 * + - col2 AS col0 FROM tab1 AS cor0
----







>







72924
72925
72926
72927
72928
72929
72930
72931
72932
72933
72934
72935
72936
72937
72938
query I rowsort
SELECT - ( + 90 ) AS col2 FROM tab0
----
-90
-90
-90

skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort
SELECT ALL 0 / 0 AS col2 FROM tab1 AS cor0 WHERE NOT ( NOT NULL IS NOT NULL )
----

query I rowsort
SELECT DISTINCT - - col0 * + - col2 AS col0 FROM tab1 AS cor0
----

Changes to test/random/aggregates/slt_good_51.test.

8964
8965
8966
8967
8968
8969
8970

8971
8972
8973
8974
8975
8976
8977

skipif mysql # not compatible
query I rowsort label-979
SELECT ALL MAX ( 0 ) FROM tab0 AS cor0
----
0


query III rowsort
SELECT DISTINCT * FROM tab0 AS cor0 WHERE NOT col2 NOT IN ( 14, - 66 * - 55 / + col1 * col2 * + col0 * col0 * + col0 + + col0, + col2 + - col0 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-981
SELECT ALL + MAX( + col1 ) col1 FROM tab2







>







8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978

skipif mysql # not compatible
query I rowsort label-979
SELECT ALL MAX ( 0 ) FROM tab0 AS cor0
----
0

skipif postgresql # PostgreSQL does not promote INTEGER (32-bit) results
query III rowsort
SELECT DISTINCT * FROM tab0 AS cor0 WHERE NOT col2 NOT IN ( 14, - 66 * - 55 / + col1 * col2 * + col0 * col0 * + col0 + + col0, + col2 + - col0 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-981
SELECT ALL + MAX( + col1 ) col1 FROM tab2

Changes to test/random/aggregates/slt_good_53.test.

40454
40455
40456
40457
40458
40459
40460

40461
40462
40463
40464
40465
40466
40467
onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-4461
SELECT - - CAST( COUNT( * ) AS SIGNED ) / - COUNT( * ) / - AVG ( ALL - col1 ) + MAX( DISTINCT col2 ) AS col1 FROM tab0 WHERE NOT + ( + col2 ) BETWEEN NULL AND + CAST( NULL AS SIGNED )
----
NULL

skipif mysql # not compatible

query I rowsort label-4461
SELECT - - CAST ( COUNT ( * ) AS INTEGER ) / - COUNT ( * ) / - AVG ( ALL - col1 ) + MAX ( DISTINCT col2 ) AS col1 FROM tab0 WHERE NOT + ( + col2 ) BETWEEN NULL AND + CAST ( NULL AS INTEGER )
----
NULL

query III rowsort
SELECT * FROM tab1 AS cor0 WHERE NOT col1 * - col1 > NULL







>







40454
40455
40456
40457
40458
40459
40460
40461
40462
40463
40464
40465
40466
40467
40468
onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-4461
SELECT - - CAST( COUNT( * ) AS SIGNED ) / - COUNT( * ) / - AVG ( ALL - col1 ) + MAX( DISTINCT col2 ) AS col1 FROM tab0 WHERE NOT + ( + col2 ) BETWEEN NULL AND + CAST( NULL AS SIGNED )
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort label-4461
SELECT - - CAST ( COUNT ( * ) AS INTEGER ) / - COUNT ( * ) / - AVG ( ALL - col1 ) + MAX ( DISTINCT col2 ) AS col1 FROM tab0 WHERE NOT + ( + col2 ) BETWEEN NULL AND + CAST ( NULL AS INTEGER )
----
NULL

query III rowsort
SELECT * FROM tab1 AS cor0 WHERE NOT col1 * - col1 > NULL

Changes to test/random/aggregates/slt_good_62.test.

22426
22427
22428
22429
22430
22431
22432

22433
22434
22435
22436
22437
22438
22439
onlyif mysql # aggregate syntax: 
query I rowsort label-2429
SELECT ALL COUNT( col0 ) / - - COUNT( * ) * - + SUM( DISTINCT - ( col1 ) ) + 13 AS col1 FROM tab0 WHERE NOT - col1 IS NOT NULL
----
NULL

skipif mysql # not compatible

query I rowsort label-2429
SELECT ALL COUNT ( col0 ) / - - COUNT ( * ) * - + SUM ( DISTINCT - ( col1 ) ) + 13 AS col1 FROM tab0 WHERE NOT - col1 IS NOT NULL
----
NULL

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-2430







>







22426
22427
22428
22429
22430
22431
22432
22433
22434
22435
22436
22437
22438
22439
22440
onlyif mysql # aggregate syntax: 
query I rowsort label-2429
SELECT ALL COUNT( col0 ) / - - COUNT( * ) * - + SUM( DISTINCT - ( col1 ) ) + 13 AS col1 FROM tab0 WHERE NOT - col1 IS NOT NULL
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort label-2429
SELECT ALL COUNT ( col0 ) / - - COUNT ( * ) * - + SUM ( DISTINCT - ( col1 ) ) + 13 AS col1 FROM tab0 WHERE NOT - col1 IS NOT NULL
----
NULL

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-2430

Changes to test/random/aggregates/slt_good_68.test.

73934
73935
73936
73937
73938
73939
73940

73941
73942
73943
73944
73945
73946
73947
query II rowsort label-8042
SELECT DISTINCT 0 AS col0, - 52 / - 0 * + col2 * + CAST( NULL AS SIGNED ) + 65 FROM tab1
----
0
NULL

skipif mysql # not compatible

query II rowsort label-8042
SELECT DISTINCT 0 AS col0, - 52 / - 0 * + col2 * + CAST ( NULL AS INTEGER ) + 65 FROM tab1
----
0
NULL

onlyif mysql # DIV for integer division: 







>







73934
73935
73936
73937
73938
73939
73940
73941
73942
73943
73944
73945
73946
73947
73948
query II rowsort label-8042
SELECT DISTINCT 0 AS col0, - 52 / - 0 * + col2 * + CAST( NULL AS SIGNED ) + 65 FROM tab1
----
0
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query II rowsort label-8042
SELECT DISTINCT 0 AS col0, - 52 / - 0 * + col2 * + CAST ( NULL AS INTEGER ) + 65 FROM tab1
----
0
NULL

onlyif mysql # DIV for integer division: 

Changes to test/random/aggregates/slt_good_70.test.

7868
7869
7870
7871
7872
7873
7874

7875
7876
7877
7878
7879
7880
7881
26
78

query III rowsort
SELECT * FROM tab2 AS cor0 WHERE ( NULL ) NOT IN ( - 76, col0 )
----


query III rowsort
SELECT DISTINCT * FROM tab0 cor0 WHERE NOT ( NULL ) BETWEEN ( 25 * 22 / ( + - 0 ) + 46 ) AND col0 + col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-859
SELECT - 59 + - 85 * + COUNT( * ) AS col0 FROM tab1 AS cor0







>







7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
26
78

query III rowsort
SELECT * FROM tab2 AS cor0 WHERE ( NULL ) NOT IN ( - 76, col0 )
----

skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query III rowsort
SELECT DISTINCT * FROM tab0 cor0 WHERE NOT ( NULL ) BETWEEN ( 25 * 22 / ( + - 0 ) + 46 ) AND col0 + col2
----

onlyif mysql # aggregate syntax: 
query I rowsort label-859
SELECT - 59 + - 85 * + COUNT( * ) AS col0 FROM tab1 AS cor0

Changes to test/random/aggregates/slt_good_72.test.

2539
2540
2541
2542
2543
2544
2545

2546
2547
2548
2549
2550
2551
2552
....
2689
2690
2691
2692
2693
2694
2695

2696
2697
2698
2699
2700
2701
2702
-167517
-25873

query III rowsort
SELECT DISTINCT * FROM tab2 AS cor0 WHERE - col1 * + 10 + + + col0 IS NULL
----


query III rowsort
SELECT * FROM tab0 AS cor0 WHERE ( NOT - 4 / + + 0 > NULL )
----

query I rowsort
SELECT ALL 87 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL
----
................................................................................

skipif mysql # not compatible
query I rowsort label-302
SELECT COUNT ( - 93 ) + + 27 FROM tab2
----
30


query I rowsort
SELECT DISTINCT + + col0 * + + col1 / + + 66 FROM tab0 WHERE NULL = + col0 + - 85 / 0
----

query III rowsort
SELECT DISTINCT * FROM tab1 AS cor0 WHERE NOT ( NOT - col2 + + 88 IS NULL )
----







>







 







>







2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
....
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
-167517
-25873

query III rowsort
SELECT DISTINCT * FROM tab2 AS cor0 WHERE - col1 * + 10 + + + col0 IS NULL
----

skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query III rowsort
SELECT * FROM tab0 AS cor0 WHERE ( NOT - 4 / + + 0 > NULL )
----

query I rowsort
SELECT ALL 87 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL
----
................................................................................

skipif mysql # not compatible
query I rowsort label-302
SELECT COUNT ( - 93 ) + + 27 FROM tab2
----
30

skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort
SELECT DISTINCT + + col0 * + + col1 / + + 66 FROM tab0 WHERE NULL = + col0 + - 85 / 0
----

query III rowsort
SELECT DISTINCT * FROM tab1 AS cor0 WHERE NOT ( NOT - col2 + + 88 IS NULL )
----

Changes to test/random/aggregates/slt_good_81.test.

1076
1077
1078
1079
1080
1081
1082

1083
1084
1085
1086
1087
1088
1089
SELECT ALL - ( + 0 ) * - 48 + - 49 + + + col1 * + 27 * - - ( - 93 ) * - + 49 * - 87 * + col0 DIV - + col0 AS col1 FROM tab1 AS cor0
----
149861453
503106422
53521916

skipif mysql # not compatible

query I rowsort label-110
SELECT ALL - ( + 0 ) * - 48 + - 49 + + + col1 * + 27 * - - ( - 93 ) * - + 49 * - 87 * + col0 / - + col0 AS col1 FROM tab1 AS cor0
----
149861453
503106422
53521916








>







1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
SELECT ALL - ( + 0 ) * - 48 + - 49 + + + col1 * + 27 * - - ( - 93 ) * - + 49 * - 87 * + col0 DIV - + col0 AS col1 FROM tab1 AS cor0
----
149861453
503106422
53521916

skipif mysql # not compatible
skipif postgresql # PostgreSQL does not promote INTEGER (32-bit) results
query I rowsort label-110
SELECT ALL - ( + 0 ) * - 48 + - 49 + + + col1 * + 27 * - - ( - 93 ) * - + 49 * - 87 * + col0 / - + col0 AS col1 FROM tab1 AS cor0
----
149861453
503106422
53521916

Changes to test/random/aggregates/slt_good_9.test.

76305
76306
76307
76308
76309
76310
76311

76312
76313
76314
76315
76316
76317
76318
skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8432
SELECT ALL + COUNT ( * ) * + CAST ( NULL AS INTEGER ) col2 FROM tab1 AS cor0
----
NULL


query III rowsort
SELECT * FROM tab2 AS cor0 WHERE + col0 * + col1 * 98 * ( col0 ) * - + 86 / - col2 > - - col1 + + 92 + - 69
----
9 values hashing to 75c998aa53ac83218cbf2feb962d0a49

onlyif mysql # aggregate syntax: 
query I rowsort label-8434







>







76305
76306
76307
76308
76309
76310
76311
76312
76313
76314
76315
76316
76317
76318
76319
skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8432
SELECT ALL + COUNT ( * ) * + CAST ( NULL AS INTEGER ) col2 FROM tab1 AS cor0
----
NULL

skipif postgresql # PostgreSQL does not promote INTEGER (32-bit) results
query III rowsort
SELECT * FROM tab2 AS cor0 WHERE + col0 * + col1 * 98 * ( col0 ) * - + 86 / - col2 > - - col1 + + 92 + - 69
----
9 values hashing to 75c998aa53ac83218cbf2feb962d0a49

onlyif mysql # aggregate syntax: 
query I rowsort label-8434

Changes to test/random/aggregates/slt_good_93.test.

78754
78755
78756
78757
78758
78759
78760

78761
78762
78763
78764
78765
78766
78767
----

skipif mysql # not compatible
query III rowsort label-8633
SELECT ALL * FROM tab1 AS cor0 WHERE col0 * + ( CAST ( + 53 AS INTEGER ) ) < col1 * - - ( + col2 ) + + 26
----


query III rowsort
SELECT ALL * FROM tab0 AS cor0 WHERE NULL NOT BETWEEN + 0 * col0 AND + ( 66 ) / + 0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8635
SELECT + MAX( ALL - col2 ) FROM tab0 AS cor0







>







78754
78755
78756
78757
78758
78759
78760
78761
78762
78763
78764
78765
78766
78767
78768
----

skipif mysql # not compatible
query III rowsort label-8633
SELECT ALL * FROM tab1 AS cor0 WHERE col0 * + ( CAST ( + 53 AS INTEGER ) ) < col1 * - - ( + col2 ) + + 26
----

skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query III rowsort
SELECT ALL * FROM tab0 AS cor0 WHERE NULL NOT BETWEEN + 0 * col0 AND + ( 66 ) / + 0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8635
SELECT + MAX( ALL - col2 ) FROM tab0 AS cor0

Changes to test/random/aggregates/slt_good_96.test.

81442
81443
81444
81445
81446
81447
81448

81449
81450
81451
81452
81453
81454
81455
onlyif mysql # aggregate syntax: 
query I rowsort label-8894
SELECT ALL 7 / + - COUNT( * ) * + + MIN( + ( + 87 ) ) AS col1 FROM tab2 cor0 WHERE NOT NULL >= NULL
----
NULL

skipif mysql # not compatible

query I rowsort label-8894
SELECT ALL 7 / + - COUNT ( * ) * + + MIN ( + ( + 87 ) ) AS col1 FROM tab2 cor0 WHERE NOT NULL >= NULL
----
NULL

query I rowsort
SELECT DISTINCT + - ( + 88 ) * col2 AS col2 FROM tab1 AS cor0







>







81442
81443
81444
81445
81446
81447
81448
81449
81450
81451
81452
81453
81454
81455
81456
onlyif mysql # aggregate syntax: 
query I rowsort label-8894
SELECT ALL 7 / + - COUNT( * ) * + + MIN( + ( + 87 ) ) AS col1 FROM tab2 cor0 WHERE NOT NULL >= NULL
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort label-8894
SELECT ALL 7 / + - COUNT ( * ) * + + MIN ( + ( + 87 ) ) AS col1 FROM tab2 cor0 WHERE NOT NULL >= NULL
----
NULL

query I rowsort
SELECT DISTINCT + - ( + 88 ) * col2 AS col2 FROM tab1 AS cor0

Changes to test/random/aggregates/slt_good_97.test.

55706
55707
55708
55709
55710
55711
55712

55713
55714
55715
55716
55717
55718
55719
onlyif mysql # aggregate syntax: 
query I rowsort label-6055
SELECT ALL 8 / - COUNT( * ) * MAX( ALL 11 ) * MIN( DISTINCT + col0 ) AS col2 FROM tab0 cor0 WHERE - col1 * + + col1 IN ( col0 )
----
NULL

skipif mysql # not compatible

query I rowsort label-6055
SELECT ALL 8 / - COUNT ( * ) * MAX ( ALL 11 ) * MIN ( DISTINCT + col0 ) AS col2 FROM tab0 cor0 WHERE - col1 * + + col1 IN ( col0 )
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-6056







>







55706
55707
55708
55709
55710
55711
55712
55713
55714
55715
55716
55717
55718
55719
55720
onlyif mysql # aggregate syntax: 
query I rowsort label-6055
SELECT ALL 8 / - COUNT( * ) * MAX( ALL 11 ) * MIN( DISTINCT + col0 ) AS col2 FROM tab0 cor0 WHERE - col1 * + + col1 IN ( col0 )
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL handles NULL in DIV/0 by differently
query I rowsort label-6055
SELECT ALL 8 / - COUNT ( * ) * MAX ( ALL 11 ) * MIN ( DISTINCT + col0 ) AS col2 FROM tab0 cor0 WHERE - col1 * + + col1 IN ( col0 )
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-6056

Changes to test/random/groupby/slt_good_0.test.

30118
30119
30120
30121
30122
30123
30124

30125
30126
30127
30128
30129
30130
30131
30132
30133
30134
30135
30136

30137
30138
30139
30140
30141
30142
30143

30144
30145
30146
30147
30148
30149
30150
.....
30257
30258
30259
30260
30261
30262
30263

30264
30265
30266
30267
30268
30269
30270
.....
30845
30846
30847
30848
30849
30850
30851

30852
30853
30854
30855
30856
30857
30858
.....
32335
32336
32337
32338
32339
32340
32341

32342
32343
32344
32345
32346
32347
32348
.....
32519
32520
32521
32522
32523
32524
32525

32526
32527
32528
32529
32530
32531
32532
.....
32588
32589
32590
32591
32592
32593
32594

32595
32596
32597
32598
32599
32600
32601
.....
32854
32855
32856
32857
32858
32859
32860

32861
32862
32863
32864
32865
32866
32867
.....
34560
34561
34562
34563
34564
34565
34566

34567
34568
34569
34570
34571
34572
34573
.....
35640
35641
35642
35643
35644
35645
35646

35647
35648
35649
35650
35651
35652
35653
.....
35842
35843
35844
35845
35846
35847
35848

35849
35850
35851
35852
35853
35854
35855
.....
36465
36466
36467
36468
36469
36470
36471

36472
36473
36474
36475
36476
36477
36478
.....
36877
36878
36879
36880
36881
36882
36883

36884
36885
36886
36887
36888
36889
36890
.....
38000
38001
38002
38003
38004
38005
38006

38007
38008
38009
38010
38011
38012
38013
.....
39693
39694
39695
39696
39697
39698
39699

39700
39701
39702
39703
39704
39705
39706
.....
40935
40936
40937
40938
40939
40940
40941

40942
40943
40944
40945
40946
40947
40948
.....
42640
42641
42642
42643
42644
42645
42646

42647
42648
42649
42650
42651
42652
42653
.....
44740
44741
44742
44743
44744
44745
44746

44747
44748
44749
44750
44751
44752
44753
.....
45866
45867
45868
45869
45870
45871
45872

45873
45874
45875
45876
45877
45878
45879
.....
46782
46783
46784
46785
46786
46787
46788

46789
46790
46791
46792
46793
46794
46795
.....
47581
47582
47583
47584
47585
47586
47587

47588
47589
47590
47591
47592
47593
47594
.....
48296
48297
48298
48299
48300
48301
48302

48303
48304
48305
48306
48307
48308
48309
.....
48336
48337
48338
48339
48340
48341
48342

48343
48344
48345
48346
48347
48348
48349
.....
48844
48845
48846
48847
48848
48849
48850

48851
48852
48853
48854
48855
48856
48857
.....
49056
49057
49058
49059
49060
49061
49062

49063
49064
49065
49066
49067
49068
49069
.....
49126
49127
49128
49129
49130
49131
49132

49133
49134
49135
49136
49137
49138
49139
.....
49824
49825
49826
49827
49828
49829
49830

49831
49832
49833
49834
49835
49836
49837
.....
52890
52891
52892
52893
52894
52895
52896

52897
52898
52899
52900
52901
52902
52903
.....
56646
56647
56648
56649
56650
56651
56652

56653
56654
56655
56656
56657
56658
56659
.....
56705
56706
56707
56708
56709
56710
56711

56712
56713
56714
56715
56716
56717
56718
.....
58009
58010
58011
58012
58013
58014
58015

58016
58017
58018
58019
58020
58021
58022
.....
59727
59728
59729
59730
59731
59732
59733

59734
59735
59736
59737
59738
59739
59740
.....
61372
61373
61374
61375
61376
61377
61378

61379
61380
61381
61382
61383
61384
61385
.....
61852
61853
61854
61855
61856
61857
61858

61859
61860
61861
61862
61863
61864
61865
.....
62363
62364
62365
62366
62367
62368
62369

62370
62371
62372
62373
62374
62375
62376
.....
63132
63133
63134
63135
63136
63137
63138

63139
63140
63141
63142
63143
63144
63145
.....
63592
63593
63594
63595
63596
63597
63598

63599
63600
63601
63602
63603
63604
63605
.....
64922
64923
64924
64925
64926
64927
64928

64929
64930
64931
64932
64933
64934
64935
.....
65816
65817
65818
65819
65820
65821
65822

65823
65824
65825
65826
65827
65828
65829
.....
65830
65831
65832
65833
65834
65835
65836

65837
65838
65839
65840
65841
65842
65843
.....
66024
66025
66026
66027
66028
66029
66030

66031
66032
66033
66034
66035
66036
66037
.....
67093
67094
67095
67096
67097
67098
67099

67100
67101
67102
67103
67104
67105
67106
.....
67703
67704
67705
67706
67707
67708
67709

67710
67711
67712
67713
67714
67715
67716
.....
68781
68782
68783
68784
68785
68786
68787

68788
68789
68790
68791
68792
68793
68794
.....
70791
70792
70793
70794
70795
70796
70797

70798
70799
70800
70801
70802
70803
70804
24

query I rowsort
SELECT DISTINCT 98 FROM tab1 AS cor0 GROUP BY cor0.col1
----
98


query I rowsort
SELECT DISTINCT - COALESCE ( - 86, + cor0.col1, cor0.col1, - cor0.col0 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
86

query I rowsort
SELECT DISTINCT COALESCE ( cor0.col0, cor0.col0 ) AS col1 FROM tab1 cor0 GROUP BY cor0.col0
----
22
28
82


query I rowsort
SELECT ALL + 33 * - COALESCE ( - 86, tab1.col2 ) + + col1 FROM tab1 GROUP BY tab1.col1
----
2844
2882
2895


query I rowsort
SELECT ALL + COALESCE ( - cor0.col1, cor0.col1, 63, - cor0.col2 ) * - cor0.col1 AS col1 FROM tab0 cor0 GROUP BY cor0.col0, col1
----
0
0
6561

................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4217
SELECT DISTINCT + ( + CASE + 64 WHEN cor0.col0 THEN NULL WHEN 77 THEN cor0.col2 END * cor0.col0 ) + + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible

query I rowsort label-4217
SELECT DISTINCT + ( + CASE + 64 WHEN cor0.col0 THEN NULL WHEN 77 THEN cor0.col2 END * cor0.col0 ) + + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col0
----
NULL

query I rowsort
SELECT ALL tab2.col0 AS col1 FROM tab2 GROUP BY tab2.col0 HAVING NOT ( NULL ) IS NOT NULL
................................................................................
query I rowsort
SELECT ALL 98 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
98
98
98


query I rowsort
SELECT ALL + - COALESCE ( 59, - cor0.col1 ) * 64 FROM tab2, tab2 AS cor0 GROUP BY tab2.col2
----
-3776
-3776
-3776

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


query I rowsort
SELECT DISTINCT cor0.col1 + - COALESCE ( + 57, + col2 ) FROM tab1 AS cor0 GROUP BY col1
----
-13
-51
0

................................................................................
query I rowsort
SELECT ALL COALESCE ( - 12, - cor0.col1, + cor0.col1 ) * + cor0.col1 * + 58 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-30624
-39672
-4176


query I rowsort
SELECT COALESCE ( - 88, + cor0.col0, cor0.col1 ) + 51 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-37
-37
-37

................................................................................
query I rowsort label-4544
SELECT - 58 / + cor1.col0 + ( 95 ) FROM tab2 cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col0
----
93
93
95


query I rowsort
SELECT DISTINCT COALESCE ( - 86, + cor0.col1, cor0.col1, - cor0.col0 ) + cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
-3
-43
-60

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


query I rowsort
SELECT ALL + COALESCE ( COALESCE ( - 86, tab1.col2 ), - tab1.col0, tab1.col1 ) AS col1 FROM tab1 GROUP BY tab1.col1
----
-86
-86
-86

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


query I rowsort
SELECT DISTINCT - COALESCE ( - 4, - cor0.col0 ) * cor0.col2 AS col1 FROM tab1 cor0 GROUP BY cor0.col1, col2, cor0.col1
----
180
284
32

................................................................................
query I rowsort
SELECT + 16 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
16
16
16


query I rowsort
SELECT COALESCE ( + 55, - tab0.col1, - tab0.col1, tab0.col0 ) AS col0 FROM tab0 GROUP BY tab0.col1
----
55
55

query I rowsort
................................................................................
query I rowsort
SELECT 83 AS col1 FROM tab1 cor0 GROUP BY cor0.col0
----
83
83
83


query I rowsort
SELECT + COALESCE ( 99, cor0.col2, cor0.col2 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col0
----
99
99
99

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


query I rowsort
SELECT DISTINCT COALESCE ( - 26, cor0.col2 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-26

query I rowsort
SELECT ALL + cor0.col0 FROM tab0 AS cor0 GROUP BY col0, cor0.col2, cor0.col2
................................................................................
SELECT - 38 + - tab1.col1 - tab1.col1 DIV COALESCE ( + 20, - tab1.col0 ) FROM tab1 GROUP BY tab1.col1
----
-44
-84
-97

skipif mysql # not compatible

query I rowsort label-5123
SELECT - 38 + - tab1.col1 - tab1.col1 / COALESCE ( + 20, - tab1.col0 ) FROM tab1 GROUP BY tab1.col1
----
-44
-84
-97

................................................................................
query I rowsort
SELECT - 46 AS col0 FROM tab1, tab0 AS cor0 GROUP BY tab1.col1
----
-46
-46
-46


query I rowsort
SELECT ALL - COALESCE ( - 11, cor0.col0, + cor0.col0 ) FROM tab1, tab0 AS cor0 GROUP BY tab1.col1
----
11
11
11

................................................................................
query I rowsort
SELECT 10 * - 57 AS col2 FROM tab2 cor0 GROUP BY cor0.col0
----
-570
-570
-570


query I rowsort
SELECT DISTINCT COALESCE ( + 93, cor0.col0 ) AS col0 FROM tab1 AS cor0 GROUP BY col2
----
93

query I rowsort
SELECT DISTINCT - 30 FROM tab0 AS cor0 GROUP BY cor0.col0
................................................................................
query I rowsort label-5683
SELECT DISTINCT - cor0.col0 DIV - 73 + COALESCE ( 83, cor0.col1 ) FROM tab1 cor0 GROUP BY cor0.col0
----
83
84

skipif mysql # not compatible

query I rowsort label-5683
SELECT DISTINCT - cor0.col0 / - 73 + COALESCE ( 83, cor0.col1 ) FROM tab1 cor0 GROUP BY cor0.col0
----
83
84

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


query I rowsort
SELECT DISTINCT + COALESCE ( + 98, cor0.col2, + col1 ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
98

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


query I rowsort
SELECT DISTINCT COALESCE ( 85, + cor0.col2, - cor0.col2, cor0.col1 ) * + col2 FROM tab0 cor0 GROUP BY cor0.col2
----
2040
3230
6715

................................................................................
query I rowsort
SELECT ALL 17 + 3 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
20
20
20


query I rowsort
SELECT DISTINCT COALESCE ( + 75, cor0.col0 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
75

query I rowsort
SELECT 22 * col1 FROM tab0 AS cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT ALL - 14 * - cor0.col0 FROM tab1 cor0 GROUP BY cor0.col0, col2
----
1148
308
392


query I rowsort
SELECT ALL + COALESCE ( 29, + cor0.col0 ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
29
29
29

................................................................................
-86

query I rowsort
SELECT DISTINCT 56 FROM tab0 AS cor0 GROUP BY cor0.col0, col1
----
56


query I rowsort
SELECT ALL CASE + 8 WHEN 76 THEN - cor0.col1 * + 8 WHEN 9 THEN NULL ELSE NULL END FROM tab0 AS cor0 GROUP BY cor0.col2, col0
----
NULL
NULL
NULL

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


query I rowsort
SELECT COALESCE ( 5, - 11, cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col1
----
5
5
5

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


query I rowsort
SELECT COALESCE ( + 6, cor0.col2 * - ( cor0.col0 ) ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
6
6
6

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


query I rowsort
SELECT COALESCE ( 30, cor0.col1 ) AS col2 FROM tab1 cor0 GROUP BY cor0.col2, cor0.col0
----
30
30
30

................................................................................
32

query I rowsort
SELECT DISTINCT + - 95 FROM tab2, tab0 AS cor0 GROUP BY cor0.col0
----
-95


query I rowsort
SELECT 16 + + cor0.col1 - COALESCE ( 88, - col0 ) * + 76 FROM tab0 AS cor0 GROUP BY col1
----
-6591
-6672

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


query I rowsort
SELECT ALL - COALESCE ( 99, - cor0.col2 + + cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
-99
-99
-99

................................................................................

query I rowsort
SELECT - 50 AS col2 FROM tab0, tab0 cor0 GROUP BY cor0.col1
----
-50
-50


query I rowsort
SELECT cor0.col0 * COALESCE ( + 81, + cor0.col2 ) + 66 FROM tab2 AS cor0 GROUP BY cor0.col0
----
1281
7437
7518

................................................................................

skipif mysql # not compatible
query I rowsort label-7316
SELECT DISTINCT CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
NULL


query I rowsort
SELECT DISTINCT COALESCE ( + 12, + cor0.col0 * + cor0.col1 ) AS col1 FROM tab0 AS cor0 GROUP BY col1
----
12

query I rowsort
SELECT DISTINCT + 92 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
................................................................................
query I rowsort
SELECT 35 FROM tab2 cor0 GROUP BY cor0.col0, cor0.col2
----
35
35
35


query I rowsort
SELECT DISTINCT + COALESCE ( + 49, cor0.col1 ) + + cor0.col0 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
132
75
92

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


query I rowsort
SELECT DISTINCT COALESCE ( + 5, cor0.col2, + col0 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
5

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
................................................................................
query I rowsort
SELECT + cor0.col1 + 43 FROM tab2 cor0 GROUP BY cor0.col1
----
102
104
84


query I rowsort
SELECT COALESCE ( 3, - cor0.col1 * + cor0.col1, 76, + cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
3
3
3

................................................................................
query I rowsort
SELECT ALL 28 + cor0.col2 AS col2 FROM tab2, tab1 AS cor0 GROUP BY cor0.col2
----
36
73
99


query I rowsort
SELECT + COALESCE ( + 83, cor0.col2, cor0.col1, - cor0.col0 * - col2 + + cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
83
83
83

................................................................................

query I rowsort
SELECT - 57 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-57
-57


query I rowsort
SELECT - cor0.col1 + COALESCE ( 61, cor0.col2 ) * 90 AS col1 FROM tab0 cor0 GROUP BY cor0.col1, cor0.col0, cor0.col1
----
5409
5490
5490

................................................................................
756

query I rowsort
SELECT DISTINCT - 38 * 15 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-570


query I rowsort
SELECT DISTINCT + COALESCE ( 76, cor0.col0 ) FROM tab2 cor0 GROUP BY cor0.col1
----
76

query I rowsort
SELECT + 68 * - cor0.col1 + + 52 FROM tab0, tab2 AS cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT cor0.col1 - 38 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
21
23
3


query I rowsort
SELECT DISTINCT + COALESCE ( 75, cor0.col2, cor0.col0 * + cor0.col1 ) + + cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
116
134
136

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


query I rowsort
SELECT DISTINCT - COALESCE ( + 60, + cor0.col2 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-60

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


query I rowsort
SELECT DISTINCT COALESCE ( - 98, col0, cor0.col1 + - 23 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
-98

query I rowsort
SELECT DISTINCT - 50 FROM tab2 AS cor0 GROUP BY cor0.col0
................................................................................
query I rowsort
SELECT DISTINCT - + 40 + + cor0.col1 AS col1 FROM tab1, tab1 AS cor0 GROUP BY cor0.col1
----
-34
17
4


query I rowsort
SELECT - COALESCE ( 22, - tab0.col0, - cor0.col1 ) FROM tab0, tab2 AS cor0 GROUP BY tab0.col1
----
-22
-22

query I rowsort
................................................................................
query I rowsort
SELECT ALL - 22 + - col1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-63
-81
-83


query I rowsort
SELECT DISTINCT cor0.col2 * COALESCE ( + 40, col1 ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
2320
3160
3480

................................................................................
onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-9102
SELECT DISTINCT COALESCE ( - 82, - cor0.col0, - CAST( NULL AS SIGNED ) ) DIV - 70 FROM tab0 AS cor0 GROUP BY cor0.col2
----
1

skipif mysql # not compatible

query I rowsort label-9102
SELECT DISTINCT COALESCE ( - 82, - cor0.col0, - CAST ( NULL AS INTEGER ) ) / - 70 FROM tab0 AS cor0 GROUP BY cor0.col2
----
1

query I rowsort
SELECT COALESCE ( - cor0.col1, cor0.col1 ) * + 31 FROM tab1 AS cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT ALL ( + cor0.col0 ) * - 49 FROM tab1 AS cor0 GROUP BY col1, cor0.col0
----
-1078
-1372
-4018


query I rowsort
SELECT DISTINCT + COALESCE ( 50, - cor0.col0 ) FROM tab0 AS cor0 GROUP BY cor0.col1
----
50

query I rowsort
SELECT DISTINCT 82 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
................................................................................
query I rowsort
SELECT 48 + + cor0.col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
105
54
92


query I rowsort
SELECT ALL + ( + COALESCE ( 27, - cor0.col0 ) ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
27
27
27

................................................................................
query I rowsort
SELECT cor0.col0 * + cor0.col2 * 3 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col0
----
17466
3780
528


query I rowsort
SELECT DISTINCT COALESCE ( + cor0.col0, 72, + 29 * cor0.col2 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
26
43
83

................................................................................
query I rowsort
SELECT 38 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
38
38
38


query I rowsort
SELECT DISTINCT cor0.col2 * COALESCE ( 65, cor0.col0 + + cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col2
----
1560
2470
5135

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


query I rowsort
SELECT ALL + COALESCE ( 74, - cor0.col2, NULLIF ( cor0.col1, cor0.col0 ) ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
74
74
74








>












>







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







30118
30119
30120
30121
30122
30123
30124
30125
30126
30127
30128
30129
30130
30131
30132
30133
30134
30135
30136
30137
30138
30139
30140
30141
30142
30143
30144
30145
30146
30147
30148
30149
30150
30151
30152
30153
.....
30260
30261
30262
30263
30264
30265
30266
30267
30268
30269
30270
30271
30272
30273
30274
.....
30849
30850
30851
30852
30853
30854
30855
30856
30857
30858
30859
30860
30861
30862
30863
.....
32340
32341
32342
32343
32344
32345
32346
32347
32348
32349
32350
32351
32352
32353
32354
.....
32525
32526
32527
32528
32529
32530
32531
32532
32533
32534
32535
32536
32537
32538
32539
.....
32595
32596
32597
32598
32599
32600
32601
32602
32603
32604
32605
32606
32607
32608
32609
.....
32862
32863
32864
32865
32866
32867
32868
32869
32870
32871
32872
32873
32874
32875
32876
.....
34569
34570
34571
34572
34573
34574
34575
34576
34577
34578
34579
34580
34581
34582
34583
.....
35650
35651
35652
35653
35654
35655
35656
35657
35658
35659
35660
35661
35662
35663
35664
.....
35853
35854
35855
35856
35857
35858
35859
35860
35861
35862
35863
35864
35865
35866
35867
.....
36477
36478
36479
36480
36481
36482
36483
36484
36485
36486
36487
36488
36489
36490
36491
.....
36890
36891
36892
36893
36894
36895
36896
36897
36898
36899
36900
36901
36902
36903
36904
.....
38014
38015
38016
38017
38018
38019
38020
38021
38022
38023
38024
38025
38026
38027
38028
.....
39708
39709
39710
39711
39712
39713
39714
39715
39716
39717
39718
39719
39720
39721
39722
.....
40951
40952
40953
40954
40955
40956
40957
40958
40959
40960
40961
40962
40963
40964
40965
.....
42657
42658
42659
42660
42661
42662
42663
42664
42665
42666
42667
42668
42669
42670
42671
.....
44758
44759
44760
44761
44762
44763
44764
44765
44766
44767
44768
44769
44770
44771
44772
.....
45885
45886
45887
45888
45889
45890
45891
45892
45893
45894
45895
45896
45897
45898
45899
.....
46802
46803
46804
46805
46806
46807
46808
46809
46810
46811
46812
46813
46814
46815
46816
.....
47602
47603
47604
47605
47606
47607
47608
47609
47610
47611
47612
47613
47614
47615
47616
.....
48318
48319
48320
48321
48322
48323
48324
48325
48326
48327
48328
48329
48330
48331
48332
.....
48359
48360
48361
48362
48363
48364
48365
48366
48367
48368
48369
48370
48371
48372
48373
.....
48868
48869
48870
48871
48872
48873
48874
48875
48876
48877
48878
48879
48880
48881
48882
.....
49081
49082
49083
49084
49085
49086
49087
49088
49089
49090
49091
49092
49093
49094
49095
.....
49152
49153
49154
49155
49156
49157
49158
49159
49160
49161
49162
49163
49164
49165
49166
.....
49851
49852
49853
49854
49855
49856
49857
49858
49859
49860
49861
49862
49863
49864
49865
.....
52918
52919
52920
52921
52922
52923
52924
52925
52926
52927
52928
52929
52930
52931
52932
.....
56675
56676
56677
56678
56679
56680
56681
56682
56683
56684
56685
56686
56687
56688
56689
.....
56735
56736
56737
56738
56739
56740
56741
56742
56743
56744
56745
56746
56747
56748
56749
.....
58040
58041
58042
58043
58044
58045
58046
58047
58048
58049
58050
58051
58052
58053
58054
.....
59759
59760
59761
59762
59763
59764
59765
59766
59767
59768
59769
59770
59771
59772
59773
.....
61405
61406
61407
61408
61409
61410
61411
61412
61413
61414
61415
61416
61417
61418
61419
.....
61886
61887
61888
61889
61890
61891
61892
61893
61894
61895
61896
61897
61898
61899
61900
.....
62398
62399
62400
62401
62402
62403
62404
62405
62406
62407
62408
62409
62410
62411
62412
.....
63168
63169
63170
63171
63172
63173
63174
63175
63176
63177
63178
63179
63180
63181
63182
.....
63629
63630
63631
63632
63633
63634
63635
63636
63637
63638
63639
63640
63641
63642
63643
.....
64960
64961
64962
64963
64964
64965
64966
64967
64968
64969
64970
64971
64972
64973
64974
.....
65855
65856
65857
65858
65859
65860
65861
65862
65863
65864
65865
65866
65867
65868
65869
.....
65870
65871
65872
65873
65874
65875
65876
65877
65878
65879
65880
65881
65882
65883
65884
.....
66065
66066
66067
66068
66069
66070
66071
66072
66073
66074
66075
66076
66077
66078
66079
.....
67135
67136
67137
67138
67139
67140
67141
67142
67143
67144
67145
67146
67147
67148
67149
.....
67746
67747
67748
67749
67750
67751
67752
67753
67754
67755
67756
67757
67758
67759
67760
.....
68825
68826
68827
68828
68829
68830
68831
68832
68833
68834
68835
68836
68837
68838
68839
.....
70836
70837
70838
70839
70840
70841
70842
70843
70844
70845
70846
70847
70848
70849
70850
24

query I rowsort
SELECT DISTINCT 98 FROM tab1 AS cor0 GROUP BY cor0.col1
----
98

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( - 86, + cor0.col1, cor0.col1, - cor0.col0 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
86

query I rowsort
SELECT DISTINCT COALESCE ( cor0.col0, cor0.col0 ) AS col1 FROM tab1 cor0 GROUP BY cor0.col0
----
22
28
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + 33 * - COALESCE ( - 86, tab1.col2 ) + + col1 FROM tab1 GROUP BY tab1.col1
----
2844
2882
2895

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( - cor0.col1, cor0.col1, 63, - cor0.col2 ) * - cor0.col1 AS col1 FROM tab0 cor0 GROUP BY cor0.col0, col1
----
0
0
6561

................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4217
SELECT DISTINCT + ( + CASE + 64 WHEN cor0.col0 THEN NULL WHEN 77 THEN cor0.col2 END * cor0.col0 ) + + CAST( NULL AS SIGNED ) FROM tab0 AS cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4217
SELECT DISTINCT + ( + CASE + 64 WHEN cor0.col0 THEN NULL WHEN 77 THEN cor0.col2 END * cor0.col0 ) + + CAST ( NULL AS INTEGER ) FROM tab0 AS cor0 GROUP BY col0
----
NULL

query I rowsort
SELECT ALL tab2.col0 AS col1 FROM tab2 GROUP BY tab2.col0 HAVING NOT ( NULL ) IS NOT NULL
................................................................................
query I rowsort
SELECT ALL 98 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col0
----
98
98
98

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + - COALESCE ( 59, - cor0.col1 ) * 64 FROM tab2, tab2 AS cor0 GROUP BY tab2.col2
----
-3776
-3776
-3776

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT cor0.col1 + - COALESCE ( + 57, + col2 ) FROM tab1 AS cor0 GROUP BY col1
----
-13
-51
0

................................................................................
query I rowsort
SELECT ALL COALESCE ( - 12, - cor0.col1, + cor0.col1 ) * + cor0.col1 * + 58 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-30624
-39672
-4176

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( - 88, + cor0.col0, cor0.col1 ) + 51 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-37
-37
-37

................................................................................
query I rowsort label-4544
SELECT - 58 / + cor1.col0 + ( 95 ) FROM tab2 cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col0
----
93
93
95

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( - 86, + cor0.col1, cor0.col1, - cor0.col0 ) + cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
-3
-43
-60

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( COALESCE ( - 86, tab1.col2 ), - tab1.col0, tab1.col1 ) AS col1 FROM tab1 GROUP BY tab1.col1
----
-86
-86
-86

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( - 4, - cor0.col0 ) * cor0.col2 AS col1 FROM tab1 cor0 GROUP BY cor0.col1, col2, cor0.col1
----
180
284
32

................................................................................
query I rowsort
SELECT + 16 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
16
16
16

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + 55, - tab0.col1, - tab0.col1, tab0.col0 ) AS col0 FROM tab0 GROUP BY tab0.col1
----
55
55

query I rowsort
................................................................................
query I rowsort
SELECT 83 AS col1 FROM tab1 cor0 GROUP BY cor0.col0
----
83
83
83

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( 99, cor0.col2, cor0.col2 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col0
----
99
99
99

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( - 26, cor0.col2 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-26

query I rowsort
SELECT ALL + cor0.col0 FROM tab0 AS cor0 GROUP BY col0, cor0.col2, cor0.col2
................................................................................
SELECT - 38 + - tab1.col1 - tab1.col1 DIV COALESCE ( + 20, - tab1.col0 ) FROM tab1 GROUP BY tab1.col1
----
-44
-84
-97

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5123
SELECT - 38 + - tab1.col1 - tab1.col1 / COALESCE ( + 20, - tab1.col0 ) FROM tab1 GROUP BY tab1.col1
----
-44
-84
-97

................................................................................
query I rowsort
SELECT - 46 AS col0 FROM tab1, tab0 AS cor0 GROUP BY tab1.col1
----
-46
-46
-46

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - COALESCE ( - 11, cor0.col0, + cor0.col0 ) FROM tab1, tab0 AS cor0 GROUP BY tab1.col1
----
11
11
11

................................................................................
query I rowsort
SELECT 10 * - 57 AS col2 FROM tab2 cor0 GROUP BY cor0.col0
----
-570
-570
-570

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( + 93, cor0.col0 ) AS col0 FROM tab1 AS cor0 GROUP BY col2
----
93

query I rowsort
SELECT DISTINCT - 30 FROM tab0 AS cor0 GROUP BY cor0.col0
................................................................................
query I rowsort label-5683
SELECT DISTINCT - cor0.col0 DIV - 73 + COALESCE ( 83, cor0.col1 ) FROM tab1 cor0 GROUP BY cor0.col0
----
83
84

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5683
SELECT DISTINCT - cor0.col0 / - 73 + COALESCE ( 83, cor0.col1 ) FROM tab1 cor0 GROUP BY cor0.col0
----
83
84

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( + 98, cor0.col2, + col1 ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
98

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( 85, + cor0.col2, - cor0.col2, cor0.col1 ) * + col2 FROM tab0 cor0 GROUP BY cor0.col2
----
2040
3230
6715

................................................................................
query I rowsort
SELECT ALL 17 + 3 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
20
20
20

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( + 75, cor0.col0 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
75

query I rowsort
SELECT 22 * col1 FROM tab0 AS cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT ALL - 14 * - cor0.col0 FROM tab1 cor0 GROUP BY cor0.col0, col2
----
1148
308
392

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( 29, + cor0.col0 ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
29
29
29

................................................................................
-86

query I rowsort
SELECT DISTINCT 56 FROM tab0 AS cor0 GROUP BY cor0.col0, col1
----
56

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL CASE + 8 WHEN 76 THEN - cor0.col1 * + 8 WHEN 9 THEN NULL ELSE NULL END FROM tab0 AS cor0 GROUP BY cor0.col2, col0
----
NULL
NULL
NULL

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 5, - 11, cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col1
----
5
5
5

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + 6, cor0.col2 * - ( cor0.col0 ) ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
6
6
6

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 30, cor0.col1 ) AS col2 FROM tab1 cor0 GROUP BY cor0.col2, cor0.col0
----
30
30
30

................................................................................
32

query I rowsort
SELECT DISTINCT + - 95 FROM tab2, tab0 AS cor0 GROUP BY cor0.col0
----
-95

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT 16 + + cor0.col1 - COALESCE ( 88, - col0 ) * + 76 FROM tab0 AS cor0 GROUP BY col1
----
-6591
-6672

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - COALESCE ( 99, - cor0.col2 + + cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
-99
-99
-99

................................................................................

query I rowsort
SELECT - 50 AS col2 FROM tab0, tab0 cor0 GROUP BY cor0.col1
----
-50
-50

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT cor0.col0 * COALESCE ( + 81, + cor0.col2 ) + 66 FROM tab2 AS cor0 GROUP BY cor0.col0
----
1281
7437
7518

................................................................................

skipif mysql # not compatible
query I rowsort label-7316
SELECT DISTINCT CAST ( NULL AS INTEGER ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
NULL

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( + 12, + cor0.col0 * + cor0.col1 ) AS col1 FROM tab0 AS cor0 GROUP BY col1
----
12

query I rowsort
SELECT DISTINCT + 92 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
................................................................................
query I rowsort
SELECT 35 FROM tab2 cor0 GROUP BY cor0.col0, cor0.col2
----
35
35
35

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( + 49, cor0.col1 ) + + cor0.col0 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
132
75
92

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( + 5, cor0.col2, + col0 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
5

query I rowsort
SELECT - col1 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
................................................................................
query I rowsort
SELECT + cor0.col1 + 43 FROM tab2 cor0 GROUP BY cor0.col1
----
102
104
84

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 3, - cor0.col1 * + cor0.col1, 76, + cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
3
3
3

................................................................................
query I rowsort
SELECT ALL 28 + cor0.col2 AS col2 FROM tab2, tab1 AS cor0 GROUP BY cor0.col2
----
36
73
99

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( + 83, cor0.col2, cor0.col1, - cor0.col0 * - col2 + + cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
83
83
83

................................................................................

query I rowsort
SELECT - 57 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-57
-57

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - cor0.col1 + COALESCE ( 61, cor0.col2 ) * 90 AS col1 FROM tab0 cor0 GROUP BY cor0.col1, cor0.col0, cor0.col1
----
5409
5490
5490

................................................................................
756

query I rowsort
SELECT DISTINCT - 38 * 15 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-570

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( 76, cor0.col0 ) FROM tab2 cor0 GROUP BY cor0.col1
----
76

query I rowsort
SELECT + 68 * - cor0.col1 + + 52 FROM tab0, tab2 AS cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT cor0.col1 - 38 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
21
23
3

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( 75, cor0.col2, cor0.col0 * + cor0.col1 ) + + cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
116
134
136

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( + 60, + cor0.col2 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-60

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( - 98, col0, cor0.col1 + - 23 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
-98

query I rowsort
SELECT DISTINCT - 50 FROM tab2 AS cor0 GROUP BY cor0.col0
................................................................................
query I rowsort
SELECT DISTINCT - + 40 + + cor0.col1 AS col1 FROM tab1, tab1 AS cor0 GROUP BY cor0.col1
----
-34
17
4

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( 22, - tab0.col0, - cor0.col1 ) FROM tab0, tab2 AS cor0 GROUP BY tab0.col1
----
-22
-22

query I rowsort
................................................................................
query I rowsort
SELECT ALL - 22 + - col1 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
-63
-81
-83

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT cor0.col2 * COALESCE ( + 40, col1 ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
2320
3160
3480

................................................................................
onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query I rowsort label-9102
SELECT DISTINCT COALESCE ( - 82, - cor0.col0, - CAST( NULL AS SIGNED ) ) DIV - 70 FROM tab0 AS cor0 GROUP BY cor0.col2
----
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-9102
SELECT DISTINCT COALESCE ( - 82, - cor0.col0, - CAST ( NULL AS INTEGER ) ) / - 70 FROM tab0 AS cor0 GROUP BY cor0.col2
----
1

query I rowsort
SELECT COALESCE ( - cor0.col1, cor0.col1 ) * + 31 FROM tab1 AS cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT ALL ( + cor0.col0 ) * - 49 FROM tab1 AS cor0 GROUP BY col1, cor0.col0
----
-1078
-1372
-4018

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( 50, - cor0.col0 ) FROM tab0 AS cor0 GROUP BY cor0.col1
----
50

query I rowsort
SELECT DISTINCT 82 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
................................................................................
query I rowsort
SELECT 48 + + cor0.col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
105
54
92

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + ( + COALESCE ( 27, - cor0.col0 ) ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
27
27
27

................................................................................
query I rowsort
SELECT cor0.col0 * + cor0.col2 * 3 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col0
----
17466
3780
528

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( + cor0.col0, 72, + 29 * cor0.col2 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
26
43
83

................................................................................
query I rowsort
SELECT 38 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
38
38
38

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT cor0.col2 * COALESCE ( 65, cor0.col0 + + cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col2
----
1560
2470
5135

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( 74, - cor0.col2, NULLIF ( cor0.col1, cor0.col0 ) ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
74
74
74

Changes to test/random/groupby/slt_good_1.test.

468
469
470
471
472
473
474

475
476
477
478
479
480
481
....
1358
1359
1360
1361
1362
1363
1364

1365
1366
1367
1368
1369
1370
1371
....
1755
1756
1757
1758
1759
1760
1761

1762
1763
1764
1765
1766
1767
1768
....
2891
2892
2893
2894
2895
2896
2897

2898
2899
2900
2901
2902
2903
2904
....
3959
3960
3961
3962
3963
3964
3965

3966
3967
3968
3969
3970
3971
3972
....
4226
4227
4228
4229
4230
4231
4232

4233
4234
4235
4236
4237
4238
4239
....
5451
5452
5453
5454
5455
5456
5457

5458
5459
5460
5461
5462
5463
5464
....
5812
5813
5814
5815
5816
5817
5818

5819
5820
5821
5822
5823
5824
5825
....
6783
6784
6785
6786
6787
6788
6789

6790
6791
6792
6793
6794
6795
6796
....
7735
7736
7737
7738
7739
7740
7741

7742
7743
7744
7745
7746
7747
7748
....
8590
8591
8592
8593
8594
8595
8596

8597
8598
8599
8600
8601
8602
8603
.....
10162
10163
10164
10165
10166
10167
10168

10169
10170
10171
10172
10173
10174
10175
.....
11663
11664
11665
11666
11667
11668
11669

11670
11671
11672
11673
11674
11675
11676
.....
12862
12863
12864
12865
12866
12867
12868

12869
12870
12871
12872
12873
12874
12875
.....
14319
14320
14321
14322
14323
14324
14325

14326
14327
14328
14329
14330
14331
14332
.....
15453
15454
15455
15456
15457
15458
15459

15460
15461
15462
15463
15464
15465
15466
.....
15545
15546
15547
15548
15549
15550
15551

15552
15553
15554
15555
15556
15557
15558
.....
16651
16652
16653
16654
16655
16656
16657

16658
16659
16660
16661
16662
16663
16664
.....
16725
16726
16727
16728
16729
16730
16731

16732
16733
16734
16735
16736
16737
16738
.....
17155
17156
17157
17158
17159
17160
17161

17162
17163
17164
17165
17166
17167
17168
.....
17242
17243
17244
17245
17246
17247
17248

17249
17250
17251
17252
17253
17254
17255
.....
17707
17708
17709
17710
17711
17712
17713

17714
17715
17716
17717
17718
17719
17720
.....
18049
18050
18051
18052
18053
18054
18055

18056
18057
18058
18059
18060
18061
18062
.....
18242
18243
18244
18245
18246
18247
18248

18249
18250
18251
18252
18253
18254
18255
.....
19311
19312
19313
19314
19315
19316
19317

19318
19319
19320
19321
19322
19323
19324
.....
20221
20222
20223
20224
20225
20226
20227

20228
20229
20230
20231
20232
20233
20234
.....
21611
21612
21613
21614
21615
21616
21617

21618
21619
21620
21621
21622
21623
21624
.....
22030
22031
22032
22033
22034
22035
22036

22037
22038
22039
22040
22041
22042
22043
.....
22723
22724
22725
22726
22727
22728
22729

22730
22731
22732
22733
22734
22735
22736
.....
23231
23232
23233
23234
23235
23236
23237

23238
23239
23240
23241
23242
23243
23244
.....
23839
23840
23841
23842
23843
23844
23845

23846
23847
23848
23849
23850
23851
23852
.....
25296
25297
25298
25299
25300
25301
25302

25303
25304
25305
25306
25307
25308
25309
.....
26031
26032
26033
26034
26035
26036
26037

26038
26039
26040
26041
26042
26043
26044
.....
26624
26625
26626
26627
26628
26629
26630

26631
26632
26633
26634
26635
26636
26637
.....
27776
27777
27778
27779
27780
27781
27782

27783
27784
27785
27786
27787
27788
27789
.....
28464
28465
28466
28467
28468
28469
28470

28471
28472
28473
28474
28475
28476
28477
.....
28654
28655
28656
28657
28658
28659
28660

28661
28662
28663
28664
28665
28666
28667
.....
28943
28944
28945
28946
28947
28948
28949

28950
28951
28952
28953
28954
28955
28956
.....
29938
29939
29940
29941
29942
29943
29944

29945
29946
29947
29948
29949
29950
29951
.....
29954
29955
29956
29957
29958
29959
29960

29961
29962
29963
29964
29965
29966
29967
.....
30127
30128
30129
30130
30131
30132
30133

30134
30135
30136
30137
30138
30139
30140
.....
30211
30212
30213
30214
30215
30216
30217

30218
30219
30220
30221
30222
30223
30224
.....
30389
30390
30391
30392
30393
30394
30395

30396
30397
30398
30399
30400
30401
30402
.....
30456
30457
30458
30459
30460
30461
30462

30463
30464
30465
30466
30467
30468
30469
.....
31067
31068
31069
31070
31071
31072
31073

31074
31075
31076
31077
31078
31079
31080
.....
31145
31146
31147
31148
31149
31150
31151

31152
31153
31154
31155
31156
31157
31158
.....
31213
31214
31215
31216
31217
31218
31219

31220
31221
31222
31223
31224
31225
31226
.....
31289
31290
31291
31292
31293
31294
31295

31296
31297
31298
31299
31300
31301
31302
.....
31395
31396
31397
31398
31399
31400
31401

31402
31403
31404
31405
31406
31407
31408
.....
31474
31475
31476
31477
31478
31479
31480

31481
31482
31483
31484
31485
31486
31487
.....
31684
31685
31686
31687
31688
31689
31690

31691
31692
31693
31694
31695
31696
31697
.....
33587
33588
33589
33590
33591
33592
33593

33594
33595
33596
33597
33598
33599
33600
.....
35148
35149
35150
35151
35152
35153
35154

35155
35156
35157
35158
35159
35160
35161
.....
35626
35627
35628
35629
35630
35631
35632

35633
35634
35635
35636
35637
35638
35639
.....
36535
36536
36537
36538
36539
36540
36541

36542
36543
36544
36545
36546
36547
36548
.....
36860
36861
36862
36863
36864
36865
36866

36867
36868
36869
36870
36871
36872
36873
.....
38083
38084
38085
38086
38087
38088
38089

38090
38091
38092
38093
38094
38095
38096
.....
38636
38637
38638
38639
38640
38641
38642

38643
38644
38645
38646
38647
38648
38649
.....
39065
39066
39067
39068
39069
39070
39071

39072
39073
39074
39075
39076
39077
39078
.....
39329
39330
39331
39332
39333
39334
39335

39336
39337
39338
39339
39340
39341
39342
.....
40147
40148
40149
40150
40151
40152
40153

40154
40155
40156
40157
40158
40159
40160
.....
40959
40960
40961
40962
40963
40964
40965

40966
40967
40968
40969
40970
40971
40972
.....
41107
41108
41109
41110
41111
41112
41113

41114
41115
41116
41117
41118
41119
41120
.....
42414
42415
42416
42417
42418
42419
42420

42421
42422
42423
42424
42425
42426
42427
.....
44091
44092
44093
44094
44095
44096
44097

44098
44099
44100
44101
44102
44103
44104
.....
46390
46391
46392
46393
46394
46395
46396

46397
46398
46399
46400
46401
46402
46403
.....
46664
46665
46666
46667
46668
46669
46670

46671
46672
46673
46674
46675
46676
46677
.....
46998
46999
47000
47001
47002
47003
47004

47005
47006
47007
47008
47009
47010
47011
.....
47557
47558
47559
47560
47561
47562
47563

47564
47565
47566
47567
47568
47569
47570
.....
47687
47688
47689
47690
47691
47692
47693

47694
47695
47696
47697
47698
47699
47700
.....
48330
48331
48332
48333
48334
48335
48336

48337
48338
48339
48340
48341
48342
48343
.....
49182
49183
49184
49185
49186
49187
49188

49189
49190
49191
49192
49193
49194
49195
.....
50312
50313
50314
50315
50316
50317
50318

50319
50320
50321
50322
50323
50324
50325
.....
52700
52701
52702
52703
52704
52705
52706

52707
52708
52709
52710
52711
52712
52713
.....
58416
58417
58418
58419
58420
58421
58422

58423
58424
58425
58426
58427
58428
58429
.....
58965
58966
58967
58968
58969
58970
58971

58972
58973
58974
58975
58976
58977
58978
.....
61358
61359
61360
61361
61362
61363
61364

61365
61366
61367
61368
61369
61370
61371
.....
61421
61422
61423
61424
61425
61426
61427

61428
61429
61430
61431
61432
61433
61434
.....
62357
62358
62359
62360
62361
62362
62363

62364
62365
62366
62367
62368
62369
62370
.....
64847
64848
64849
64850
64851
64852
64853

64854
64855
64856
64857
64858
64859
64860
.....
69001
69002
69003
69004
69005
69006
69007

69008
69009
69010
69011
69012
69013
69014
.....
70953
70954
70955
70956
70957
70958
70959

70960
70961
70962
70963
70964
70965
70966
.....
70974
70975
70976
70977
70978
70979
70980

70981
70982
70983
70984
70985
70986
70987
.....
71459
71460
71461
71462
71463
71464
71465

71466
71467
71468
71469
71470
71471
71472
.....
72898
72899
72900
72901
72902
72903
72904

72905
72906
72907
72908
72909
72910
72911
58

query I rowsort
SELECT DISTINCT 20 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
20


query I rowsort
SELECT + COALESCE ( + 3, 40 * cor0.col0 ) AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
3
3
3

................................................................................
query I rowsort
SELECT 67 AS col0 FROM tab1 cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col0
----
67
67
67


query I rowsort
SELECT DISTINCT + COALESCE ( 29, + tab1.col1 ) AS col0 FROM tab1, tab0 AS cor0, tab2 AS cor1 GROUP BY cor1.col2
----
29

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


query I rowsort
SELECT DISTINCT + COALESCE ( - 85, + cor0.col2 + 58 ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
-85

query I rowsort
SELECT cor1.col0 AS col2 FROM tab2 AS cor0 CROSS JOIN tab1 cor1 GROUP BY cor1.col0, cor1.col1
................................................................................
query I rowsort
SELECT ALL - cor0.col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( cor0.col1 ) IS NULL
----
-41
-59
-61


query I rowsort
SELECT DISTINCT - + COALESCE ( - 95, + tab0.col0 ) AS col1 FROM tab0 GROUP BY tab0.col2
----
95

query I rowsort
SELECT DISTINCT + 4 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
................................................................................
query I rowsort label-549
SELECT COALESCE ( + 1, cor0.col0 ) + - CAST( NULL AS DECIMAL ) FROM tab1, tab0 AS cor0, tab1 AS cor1 GROUP BY cor0.col1
----
NULL
NULL

skipif mysql # not compatible

query I rowsort label-549
SELECT COALESCE ( + 1, cor0.col0 ) + - CAST ( NULL AS REAL ) FROM tab1, tab0 AS cor0, tab1 AS cor1 GROUP BY cor0.col1
----
NULL
NULL

query I rowsort
................................................................................
query I rowsort
SELECT ALL 47 FROM tab2, tab2 AS cor0 GROUP BY cor0.col0
----
47
47
47


query I rowsort
SELECT + COALESCE ( 89, cor0.col1 * + cor0.col1 ) FROM tab0 cor0 GROUP BY cor0.col2, cor0.col2, cor0.col0
----
89
89
89

................................................................................
query I rowsort
SELECT DISTINCT + cor0.col0 * - 69 col0 FROM tab2, tab1 AS cor0, tab0 AS cor1 GROUP BY cor0.col0
----
-1518
-1932
-5658


query I rowsort
SELECT - COALESCE ( - COALESCE ( + col0, tab1.col0 ), 76, + col1 ) AS col1 FROM tab1 GROUP BY col0
----
22
28
82

................................................................................
query I rowsort
SELECT + - 27 AS col1 FROM tab2 GROUP BY tab2.col1
----
-27
-27
-27


query I rowsort
SELECT - NULLIF ( + col2, cor0.col2 ) * - COALESCE ( 78, + cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

................................................................................
query I rowsort label-932
SELECT ALL col1 / 39 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
0
1
1


query I rowsort
SELECT ALL - CASE - cor0.col2 WHEN cor0.col2 THEN col2 ELSE cor0.col2 END col2 FROM tab1 cor0 GROUP BY cor0.col2
----
-45
-71
-8

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


query I rowsort
SELECT DISTINCT - COALESCE ( - COALESCE ( 69, col2, + 41, cor0.col1 ), - cor0.col2, 80 ) * cor0.col0 + 76 FROM tab0 cor0 GROUP BY cor0.col2, cor0.col0
----
1870
3043
5803

................................................................................
query I rowsort
SELECT DISTINCT - 94 + - tab0.col2 FROM tab0 GROUP BY tab0.col2
----
-118
-132
-173


query I rowsort
SELECT - COALESCE ( + COALESCE ( - 21, tab1.col0 ), + cor0.col0 ) * - cor0.col2 FROM tab1, tab2 AS cor0 GROUP BY cor0.col2
----
-1218
-1659
-1827

................................................................................
query I rowsort
SELECT ALL 14 * - COALESCE ( - 87, tab0.col2 ) AS col2 FROM tab0 GROUP BY tab0.col2
----
1218
1218
1218


query I rowsort
SELECT CASE - 75 WHEN - 96 THEN - cor0.col1 * - ( cor0.col0 ) WHEN cor0.col0 THEN NULL END FROM tab1 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

................................................................................

query I rowsort
SELECT ALL - 42 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-42
-42


query I rowsort
SELECT ALL COALESCE ( 72, + cor0.col2 + - 8 ) FROM tab1 cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor0.col0
----
72
72
72

................................................................................
query I rowsort
SELECT ( - cor0.col1 ) + + 59 * + cor0.col1 + 1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
2553
3307
349


query I rowsort
SELECT COALESCE ( + cor0.col1, 84, cor0.col0 + cor0.col2 ) * - 62 AS col0 FROM tab2 cor0 GROUP BY cor0.col1
----
-2542
-3658
-3782

................................................................................
query I rowsort
SELECT ALL 35 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
35
35
35


query I rowsort
SELECT ALL - + COALESCE ( + 64, + col2 ) + + tab0.col0 FROM tab0 GROUP BY tab0.col0
----
-21
-38
19

................................................................................
query I rowsort
SELECT + 3 FROM tab2, tab1 AS cor0 GROUP BY tab2.col0
----
3
3
3


query I rowsort
SELECT COALESCE ( + 55, - tab0.col2 + + tab0.col2 ) FROM tab0 GROUP BY tab0.col1
----
55
55

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


query I rowsort
SELECT ALL - COALESCE ( + 57, + cor0.col2 * cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col1
----
-57
-57

query I rowsort
................................................................................
query I rowsort
SELECT + + cor0.col2 * cor0.col2 + - 4 FROM tab1, tab0 cor0 GROUP BY cor0.col2
----
1440
572
6237


query I rowsort
SELECT + COALESCE ( 47, - 49 * cor0.col1, col0 * cor0.col1, + col2 + cor0.col0 * - cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
47
47
47

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


query I rowsort
SELECT COALESCE ( - 22, col2 ) FROM tab2 GROUP BY col1
----
-22
-22
-22

................................................................................
query I rowsort
SELECT + 80 FROM tab1 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col2
----
80
80
80


query I rowsort
SELECT DISTINCT - CASE - cor0.col1 WHEN COALESCE ( + 63, cor0.col2 * col2 ) + cor0.col1 THEN cor0.col1 END AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
NULL

query I rowsort
SELECT - 40 FROM tab1 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor0.col1
................................................................................
SELECT ALL COALESCE ( 57, - col2 DIV col0 + + ( 49 ) * cor0.col1 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col0
----
57
57
57

skipif mysql # not compatible

query I rowsort label-2339
SELECT ALL COALESCE ( 57, - col2 / col0 + + ( 49 ) * cor0.col1 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col0
----
57
57
57

................................................................................
query I rowsort label-2404
SELECT DISTINCT - cor0.col0 DIV - 73 + COALESCE ( 83, + cor0.col0 + + cor0.col2, cor0.col2 * - cor0.col0 - - cor0.col2 ) FROM tab1 cor0 GROUP BY cor0.col0
----
83
84

skipif mysql # not compatible

query I rowsort label-2404
SELECT DISTINCT - cor0.col0 / - 73 + COALESCE ( 83, + cor0.col0 + + cor0.col2, cor0.col2 * - cor0.col0 - - cor0.col2 ) FROM tab1 cor0 GROUP BY cor0.col0
----
83
84

query I rowsort
................................................................................
query I rowsort label-2446
SELECT - 91 / 55 + + cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
25
42
82


query I rowsort
SELECT ALL COALESCE ( - 13, + cor1.col2, - cor1.col2 ) FROM tab0 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor1.col1
----
-13
-13

query I rowsort
................................................................................
onlyif mysql # DIV for integer division: 
query I rowsort label-2470
SELECT DISTINCT + COALESCE ( + 98, cor0.col2, + cor0.col2 DIV 71 + col1 * - cor0.col2 ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
98

skipif mysql # not compatible

query I rowsort label-2470
SELECT DISTINCT + COALESCE ( + 98, cor0.col2, + cor0.col2 / 71 + col1 * - cor0.col2 ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
98

query I rowsort
SELECT DISTINCT 73 * - cor0.col0 AS col0 FROM tab1 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor0.col0, cor1.col1, cor1.col0
................................................................................
-700

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


query I rowsort
SELECT DISTINCT COALESCE ( + 75, - cor0.col2 + - cor0.col0, + cor0.col2 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
75

query I rowsort
SELECT - 65 * 90 AS col1 FROM tab1 cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT ALL - COALESCE ( tab0.col0, tab0.col0 * tab0.col0 ) FROM tab0 GROUP BY tab0.col0
----
-26
-43
-83


query I rowsort
SELECT COALESCE ( 30, cor0.col1 * - cor0.col1, NULLIF ( - cor0.col2, - cor0.col1 * - CASE - col0 WHEN cor0.col2 THEN cor0.col2 WHEN - ( 78 ) THEN cor0.col0 * - cor0.col0 ELSE NULL END + cor0.col0 * cor0.col2 ) ) AS col1 FROM tab1 cor0 GROUP BY cor0.col2, cor0.col0
----
30
30
30

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


query I rowsort
SELECT DISTINCT + COALESCE ( - 43, + cor0.col1 - + cor0.col2, + 80 + + cor0.col1 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-43

query I rowsort
SELECT DISTINCT ( 10 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT ALL + tab2.col0 * + 25 FROM tab2 GROUP BY tab2.col0
----
2275
2300
375


query I rowsort
SELECT col2 * COALESCE ( - 62 * - 77, col0 + NULLIF ( cor0.col1 - cor0.col0, - col0 - - cor0.col1 ) ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
276892
377146
415338

................................................................................
onlyif mysql # DIV for integer division: 
query I rowsort label-3085
SELECT DISTINCT COALESCE ( + 5, cor0.col2 + - col2, cor0.col0 * - cor0.col0, cor0.col0 DIV 56 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
5

skipif mysql # not compatible

query I rowsort label-3085
SELECT DISTINCT COALESCE ( + 5, cor0.col2 + - col2, cor0.col0 * - cor0.col0, cor0.col0 / 56 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
5

query I rowsort
SELECT DISTINCT + + 73 FROM tab1 GROUP BY tab1.col0
................................................................................
query I rowsort
SELECT + 30 * cor0.col2 + cor0.col1 * NULLIF ( + cor0.col2, cor0.col2 * 58 ) FROM tab0 AS cor0 GROUP BY col1, cor0.col2
----
1140
2370
2664


query I rowsort
SELECT COALESCE ( 3, - cor0.col1 * + cor0.col1, 76, + cor0.col0 * 65 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
3
3
3

................................................................................

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


query I rowsort
SELECT cor0.col2 + - cor0.col0 * + NULLIF ( COALESCE ( cor0.col2, - 37, + ( - cor0.col0 ) + cor0.col1 ) - + 9, - 15 ) AS col0 FROM tab0 cor0 GROUP BY cor0.col0, cor0.col2
----
-1741
-2369
-621

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


query I rowsort
SELECT DISTINCT COALESCE ( - 98, + cor0.col2 + cor0.col1, col1 + + cor0.col2, - cor0.col1 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-98

query I rowsort
SELECT DISTINCT + 57 FROM tab0 GROUP BY tab0.col1
................................................................................
query I rowsort
SELECT ALL + 43 FROM tab2 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col2, cor0.col0
----
43
43
43


query I rowsort
SELECT DISTINCT cor0.col2 * COALESCE ( + 40, + cor0.col0 + cor0.col0 ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
2320
3160
3480

................................................................................
SELECT ALL + ( + COALESCE ( 27, cor0.col2 DIV cor0.col1, - 39 + cor0.col0 ) ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
27
27
27

skipif mysql # not compatible

query I rowsort label-3616
SELECT ALL + ( + COALESCE ( 27, cor0.col2 / cor0.col1, - 39 + cor0.col0 ) ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
27
27
27

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


query I rowsort
SELECT ALL + COALESCE ( 74, - cor0.col2, - cor0.col0 * cor0.col2 ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
74
74
74

................................................................................
SELECT COALESCE ( 51, - col0 + - cor0.col1, - CASE - cor0.col1 WHEN + cor0.col1 + - 44 THEN NULL WHEN cor0.col2 THEN + cor0.col1 + - CASE + COALESCE ( + col0, - col1 ) WHEN COALESCE ( + cor0.col1, cor0.col0 / CAST( 7 AS SIGNED ) ) * + cor0.col1 THEN + cor0.col0 END * - cor0.col0 WHEN cor0.col1 THEN NULL WHEN cor0.col0 THEN NULL END ) * 78 FROM tab2 cor0 GROUP BY cor0.col2
----
3978
3978
3978

skipif mysql # not compatible

query I rowsort label-3865
SELECT COALESCE ( 51, - col0 + - cor0.col1, - CASE - cor0.col1 WHEN + cor0.col1 + - 44 THEN NULL WHEN cor0.col2 THEN + cor0.col1 + - CASE + COALESCE ( + col0, - col1 ) WHEN COALESCE ( + cor0.col1, cor0.col0 / CAST ( 7 AS INTEGER ) ) * + cor0.col1 THEN + cor0.col0 END * - cor0.col0 WHEN cor0.col1 THEN NULL WHEN cor0.col0 THEN NULL END ) * 78 FROM tab2 cor0 GROUP BY cor0.col2
----
3978
3978
3978

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


query I rowsort
SELECT + COALESCE ( - 38, cor0.col2, col1 + 90 * + cor0.col1 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
-38
-38
-38

................................................................................
query I rowsort
SELECT + 55 AS col0 FROM tab2 GROUP BY tab2.col0
----
55
55
55


query I rowsort
SELECT DISTINCT + COALESCE ( - 85, + cor0.col2 + + 3 * + cor0.col0, 58, + cor0.col1 + ( cor0.col2 - cor0.col0 ) ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
-85

query I rowsort
SELECT DISTINCT - cor1.col1 FROM tab2 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor0.col1, cor1.col1
................................................................................
SELECT COALESCE ( 76, - tab1.col1 DIV - col0 ) FROM tab1 GROUP BY tab1.col1
----
76
76
76

skipif mysql # not compatible

query I rowsort label-4068
SELECT COALESCE ( 76, - tab1.col1 / - col0 ) FROM tab1 GROUP BY tab1.col1
----
76
76
76

................................................................................
SELECT + cor0.col0 DIV + COALESCE ( - 39, cor0.col2 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-2
0
0

skipif mysql # not compatible

query I rowsort label-4069
SELECT + cor0.col0 / + COALESCE ( - 39, cor0.col2 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-2
0
0

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


query I rowsort
SELECT CASE col2 WHEN + 52 THEN - 52 * cor0.col2 END col0 FROM tab1 cor0 GROUP BY col2, cor0.col2
----
NULL
NULL
NULL

................................................................................
query I rowsort
SELECT ALL - cor0.col0 FROM tab0 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor0.col0
----
-26
-43
-83


query I rowsort
SELECT DISTINCT ( - COALESCE ( + 12, - tab2.col1 ) ) FROM tab2 GROUP BY col2
----
-12

query I rowsort
SELECT - 65 AS col0 FROM tab2 GROUP BY tab2.col0
................................................................................
83

query I rowsort
SELECT cor0.col2 AS col2 FROM tab1 AS cor0 CROSS JOIN tab2 cor1 GROUP BY cor1.col0, cor0.col2
----
9 values hashing to 66267ca705f58a4488972e09499aeb2b


query I rowsort
SELECT ALL - CASE cor0.col2 WHEN cor0.col2 THEN col2 ELSE cor0.col2 END col2 FROM tab1 cor0 GROUP BY cor0.col2
----
-45
-71
-8

................................................................................
-64

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


query I rowsort
SELECT + COALESCE ( 32, - cor0.col2 * cor0.col1, + cor0.col0 ) FROM tab1 AS cor0 GROUP BY col0
----
32
32
32

................................................................................
query I rowsort
SELECT - 93 + 49 FROM tab2 GROUP BY tab2.col2
----
-44
-44
-44


query I rowsort
SELECT COALESCE ( 62, cor0.col1 ) AS col2 FROM tab0 cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor1.col0
----
62
62
62

................................................................................
query I rowsort
SELECT ALL - 78 FROM tab0 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col0
----
-78
-78
-78


query I rowsort
SELECT COALESCE ( 29, - col1 + NULLIF ( + cor0.col0 + - 92, - cor0.col1 ) * 75, + 9, + cor0.col1 + + cor0.col0 ) + + cor0.col1 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
110
29

skipif postgresql # PostgreSQL requires AS when renaming output columns
................................................................................
query I rowsort
SELECT ALL 57 * - 24 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-1368
-1368
-1368


query I rowsort
SELECT COALESCE ( - 54, cor0.col0 + - cor0.col1 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-54
-54
-54

................................................................................
SELECT DISTINCT - cor0.col2 * CASE 41 WHEN + 82 THEN col1 DIV 13 ELSE 38 END AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-1710
-2698
-304

skipif mysql # not compatible

query I rowsort label-4254
SELECT DISTINCT - cor0.col2 * CASE 41 WHEN + 82 THEN col1 / 13 ELSE 38 END AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-1710
-2698
-304

................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4268
SELECT DISTINCT COALESCE ( - 46, cor0.col1, + cor0.col2, cor0.col2 * cor0.col1 - + col0 ) * + CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL

skipif mysql # not compatible

query I rowsort label-4268
SELECT DISTINCT COALESCE ( - 46, cor0.col1, + cor0.col2, cor0.col2 * cor0.col1 - + col0 ) * + CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL

query I rowsort
SELECT ALL + cor0.col0 AS col0 FROM tab1, tab2 AS cor0 GROUP BY cor0.col0
................................................................................
query I rowsort
SELECT - 13 FROM tab0 GROUP BY tab0.col2
----
-13
-13
-13


query I rowsort
SELECT CASE 75 WHEN - 96 THEN - cor0.col1 * - ( cor0.col0 ) WHEN cor0.col0 THEN NULL END FROM tab1 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

................................................................................
query I rowsort
SELECT 63 * col0 FROM tab1 GROUP BY col0
----
1386
1764
5166


query I rowsort
SELECT COALESCE ( + 47, col2 ) AS col2 FROM tab0 GROUP BY tab0.col1
----
47
47

query I rowsort
................................................................................
query I rowsort
SELECT ALL cor0.col0 + 76 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
104
158
98


query I rowsort
SELECT DISTINCT - COALESCE ( 11, + cor0.col0 * cor0.col2 ) FROM tab1 AS cor0 GROUP BY col2
----
-11

query I rowsort
SELECT cor0.col1 * - cor0.col0 FROM tab0 cor0 GROUP BY cor0.col0, cor0.col1
................................................................................

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


query I rowsort
SELECT COALESCE ( 96, - cor0.col2 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
96
96

query I rowsort
................................................................................
query I rowsort
SELECT ALL 52 AS col2 FROM tab2 GROUP BY tab2.col2
----
52
52
52


query I rowsort
SELECT ALL COALESCE ( 63, col2, cor0.col2 * + cor0.col0 + cor0.col0 * cor0.col1 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col0
----
63
63
63

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


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

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

query I rowsort
SELECT DISTINCT 65 AS col2 FROM tab2 GROUP BY tab2.col0
----
65


query I rowsort
SELECT DISTINCT + CASE col2 WHEN + cor0.col1 + - 18 THEN NULL ELSE col1 END col0 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col2
----
44
57
6

................................................................................
query I rowsort
SELECT - 7 * 50 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-350
-350
-350


query I rowsort
SELECT COALESCE ( - 60, - cor0.col2 ) + - 72 * 82 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-5964
-5964
-5964

................................................................................
query I rowsort
SELECT 16 FROM tab0 cor0 GROUP BY cor0.col2, cor0.col2
----
16
16
16


query I rowsort
SELECT ALL - COALESCE ( 19, cor0.col1 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
-19
-19
-19

................................................................................
query I rowsort
SELECT ALL - col0 * ( - 87 ) + + 89 col2 FROM tab2 cor0 GROUP BY cor0.col0
----
1394
8006
8093


query I rowsort
SELECT - COALESCE ( 90, cor1.col1 + 31 ) FROM tab2 AS cor0 CROSS JOIN tab2 cor1 GROUP BY cor1.col0, cor0.col1
----
9 values hashing to f6f26b9a04da14807208b93d507095c5

query I rowsort
SELECT DISTINCT - 52 - cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2, col1, col0
................................................................................
51

query I rowsort
SELECT DISTINCT 69 + 36 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
105


query I rowsort
SELECT - COALESCE ( + 39, col1 + - 65 ) FROM tab2 AS cor0 GROUP BY col2, cor0.col2
----
-39
-39
-39

................................................................................
-79

query I rowsort
SELECT DISTINCT 36 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
36


query I rowsort
SELECT + NULLIF ( COALESCE ( cor0.col0, 94, cor0.col1 * cor0.col0 + + cor0.col0 * 33 ), + 90 ) FROM tab2 AS cor0 GROUP BY cor0.col0, col0
----
15
91
92

................................................................................
query I rowsort
SELECT + 13 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
13
13
13


query I rowsort
SELECT ALL + COALESCE ( + 26, + cor0.col1, + 66, + col2 ) FROM tab2 AS cor0 GROUP BY col1
----
26
26
26

................................................................................
query I rowsort
SELECT ALL 84 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
84
84
84


query I rowsort
SELECT - COALESCE ( + 11, cor0.col1 + + cor0.col2, 62 ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
-11
-11
-11

................................................................................
query I rowsort
SELECT ALL 85 FROM tab1 AS cor0 GROUP BY cor0.col2
----
85
85
85


query I rowsort
SELECT 66 + COALESCE ( + 68, + cor0.col2 * + 81 ) FROM tab1 AS cor0 GROUP BY col1
----
134
134
134

................................................................................
onlyif mysql # DIV for integer division: 
query I rowsort label-6014
SELECT DISTINCT + COALESCE ( 96, col0, cor0.col1 + cor0.col2 DIV - cor0.col0 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
96

skipif mysql # not compatible

query I rowsort label-6014
SELECT DISTINCT + COALESCE ( 96, col0, cor0.col1 + cor0.col2 / - cor0.col0 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
96

query I rowsort
SELECT + 79 FROM tab2 cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT 91 - cor0.col0 FROM tab0 cor0 GROUP BY cor0.col0
----
48
65
8


query I rowsort
SELECT + COALESCE ( - 71, cor0.col2 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-71
-71
-71

................................................................................
query I rowsort
SELECT DISTINCT - cor0.col0 * + COALESCE ( 19, - col0 * + cor0.col0 + cor0.col1, cor0.col1 ) FROM tab0 AS cor0 GROUP BY col0, cor0.col1
----
-1577
-494
-817


query I rowsort
SELECT ALL + COALESCE ( - 92, - cor0.col2 ) FROM tab0 AS cor0 GROUP BY cor0.col1
----
-92
-92

query I rowsort
................................................................................
query I rowsort
SELECT ( COALESCE ( - cor0.col0, 56 + + cor0.col0 ) ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
-15
-91
-92


query I rowsort
SELECT DISTINCT COALESCE ( + 98, cor0.col1, cor0.col2 * - 54, 94 - - cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1, col0
----
98

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


query I rowsort
SELECT + COALESCE ( - 20, cor0.col2 ) FROM tab0 AS cor0 GROUP BY cor0.col1
----
-20
-20

query I rowsort
................................................................................
0

query I rowsort
SELECT DISTINCT 89 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
89


query I rowsort
SELECT DISTINCT - + COALESCE ( 91, tab0.col2 ) * 85 FROM tab0 GROUP BY tab0.col0
----
-7735

query I rowsort
SELECT ALL + 7 + cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
................................................................................
query I rowsort label-6590
SELECT ALL + 65 / - 76 AS col2 FROM tab0, tab2 cor0 GROUP BY cor0.col2
----
0
0
0


query I rowsort
SELECT DISTINCT cor0.col0 + COALESCE ( + ( 74 ), - cor0.col0 * 18, + cor0.col0 + + cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
165
166
89

................................................................................
query I rowsort label-6699
SELECT DISTINCT - - COALESCE ( col1, CAST( + 52 AS SIGNED ) + 63, + tab0.col0 * tab0.col0 ) FROM tab0 GROUP BY col1
----
0
81

skipif mysql # not compatible

query I rowsort label-6699
SELECT DISTINCT - - COALESCE ( col1, CAST ( + 52 AS INTEGER ) + 63, + tab0.col0 * tab0.col0 ) FROM tab0 GROUP BY col1
----
0
81

onlyif mysql # DIV for integer division: 
................................................................................
query I rowsort label-6852
SELECT ALL + cor0.col2 / cor0.col2 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
1
1
1


query I rowsort
SELECT ALL COALESCE ( 94, col0 * - CASE - cor0.col2 WHEN col2 + cor0.col2 * cor0.col1 THEN NULL WHEN + col2 THEN NULL ELSE - cor0.col2 END - col2 ) * cor0.col2 + cor0.col2 * cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
13667
15747
8816

................................................................................

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


query I rowsort
SELECT ALL COALESCE ( - 16, cor0.col1 * cor0.col2 ) AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-16
-16
-16

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


query I rowsort
SELECT ALL COALESCE ( + 24, col0 * cor0.col2 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
24
24
24

................................................................................

query I rowsort
SELECT 26 FROM tab0 GROUP BY col1
----
26
26


query I rowsort
SELECT + COALESCE ( - 67, + cor0.col1 * col0 ) FROM tab0 AS cor0 GROUP BY cor0.col2
----
-67
-67
-67

................................................................................
query I rowsort
SELECT DISTINCT + cor0.col0 * 33 - cor0.col0 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
1376
2656
832


query I rowsort
SELECT - COALESCE ( 40, - cor0.col1 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-40
-40
-40

................................................................................
query I rowsort
SELECT DISTINCT col2 * + 77 FROM tab2 GROUP BY col2
----
4466
6083
6699


query I rowsort
SELECT COALESCE ( - 94, - cor0.col1 * cor0.col2 ) FROM tab2 AS cor0 GROUP BY cor0.col2, col0
----
-94
-94
-94

................................................................................
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8479
SELECT ALL - 25 / 28 col1 FROM tab0 GROUP BY tab0.col1
----
0
0


query I rowsort
SELECT - COALESCE ( 93, cor0.col1, 38 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-93
-93
-93

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


query I rowsort
SELECT - COALESCE ( - 22, - tab1.col0 * 21 ) * 21 FROM tab1 GROUP BY tab1.col1
----
462
462
462

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


query I rowsort
SELECT COALESCE ( + 29, cor0.col0, + cor0.col2 * cor0.col1 - + cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
29
29
29

................................................................................
query I rowsort
SELECT ALL - 87 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-87
-87
-87


query I rowsort
SELECT COALESCE ( + 42, col2 + cor0.col2 * col0 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
42
42
42

................................................................................
query I rowsort
SELECT 32 AS col0 FROM tab2 cor0 GROUP BY cor0.col1
----
32
32
32


query I rowsort
SELECT ALL - COALESCE ( 57, cor0.col0, COALESCE ( CASE col0 WHEN - col0 THEN NULL WHEN cor0.col0 * cor0.col2 THEN NULL WHEN + col0 THEN - cor0.col1 END, - 93, cor0.col2 ) ) + + col2 * - cor0.col2 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-121
-2082
-5098

................................................................................
81

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


query I rowsort
SELECT DISTINCT COALESCE ( 71, cor0.col2 + - cor0.col2 ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
71

query I rowsort
SELECT ALL + col0 AS col0 FROM tab1 GROUP BY col0
................................................................................
SELECT + COALESCE ( 21, + cor0.col0, - CAST( NULL AS SIGNED ), cor0.col2 + cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
21
21
21

skipif mysql # not compatible

query I rowsort label-9945
SELECT + COALESCE ( 21, + cor0.col0, - CAST ( NULL AS INTEGER ), cor0.col2 + cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
21
21
21








>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
....
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
....
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
....
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
....
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
....
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
....
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
....
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
....
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
....
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
....
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
.....
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
.....
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
.....
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
.....
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
.....
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
.....
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
.....
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
.....
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
.....
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
.....
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
.....
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
.....
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
.....
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
.....
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
.....
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
.....
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
.....
22057
22058
22059
22060
22061
22062
22063
22064
22065
22066
22067
22068
22069
22070
22071
.....
22751
22752
22753
22754
22755
22756
22757
22758
22759
22760
22761
22762
22763
22764
22765
.....
23260
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
.....
23869
23870
23871
23872
23873
23874
23875
23876
23877
23878
23879
23880
23881
23882
23883
.....
25327
25328
25329
25330
25331
25332
25333
25334
25335
25336
25337
25338
25339
25340
25341
.....
26063
26064
26065
26066
26067
26068
26069
26070
26071
26072
26073
26074
26075
26076
26077
.....
26657
26658
26659
26660
26661
26662
26663
26664
26665
26666
26667
26668
26669
26670
26671
.....
27810
27811
27812
27813
27814
27815
27816
27817
27818
27819
27820
27821
27822
27823
27824
.....
28499
28500
28501
28502
28503
28504
28505
28506
28507
28508
28509
28510
28511
28512
28513
.....
28690
28691
28692
28693
28694
28695
28696
28697
28698
28699
28700
28701
28702
28703
28704
.....
28980
28981
28982
28983
28984
28985
28986
28987
28988
28989
28990
28991
28992
28993
28994
.....
29976
29977
29978
29979
29980
29981
29982
29983
29984
29985
29986
29987
29988
29989
29990
.....
29993
29994
29995
29996
29997
29998
29999
30000
30001
30002
30003
30004
30005
30006
30007
.....
30167
30168
30169
30170
30171
30172
30173
30174
30175
30176
30177
30178
30179
30180
30181
.....
30252
30253
30254
30255
30256
30257
30258
30259
30260
30261
30262
30263
30264
30265
30266
.....
30431
30432
30433
30434
30435
30436
30437
30438
30439
30440
30441
30442
30443
30444
30445
.....
30499
30500
30501
30502
30503
30504
30505
30506
30507
30508
30509
30510
30511
30512
30513
.....
31111
31112
31113
31114
31115
31116
31117
31118
31119
31120
31121
31122
31123
31124
31125
.....
31190
31191
31192
31193
31194
31195
31196
31197
31198
31199
31200
31201
31202
31203
31204
.....
31259
31260
31261
31262
31263
31264
31265
31266
31267
31268
31269
31270
31271
31272
31273
.....
31336
31337
31338
31339
31340
31341
31342
31343
31344
31345
31346
31347
31348
31349
31350
.....
31443
31444
31445
31446
31447
31448
31449
31450
31451
31452
31453
31454
31455
31456
31457
.....
31523
31524
31525
31526
31527
31528
31529
31530
31531
31532
31533
31534
31535
31536
31537
.....
31734
31735
31736
31737
31738
31739
31740
31741
31742
31743
31744
31745
31746
31747
31748
.....
33638
33639
33640
33641
33642
33643
33644
33645
33646
33647
33648
33649
33650
33651
33652
.....
35200
35201
35202
35203
35204
35205
35206
35207
35208
35209
35210
35211
35212
35213
35214
.....
35679
35680
35681
35682
35683
35684
35685
35686
35687
35688
35689
35690
35691
35692
35693
.....
36589
36590
36591
36592
36593
36594
36595
36596
36597
36598
36599
36600
36601
36602
36603
.....
36915
36916
36917
36918
36919
36920
36921
36922
36923
36924
36925
36926
36927
36928
36929
.....
38139
38140
38141
38142
38143
38144
38145
38146
38147
38148
38149
38150
38151
38152
38153
.....
38693
38694
38695
38696
38697
38698
38699
38700
38701
38702
38703
38704
38705
38706
38707
.....
39123
39124
39125
39126
39127
39128
39129
39130
39131
39132
39133
39134
39135
39136
39137
.....
39388
39389
39390
39391
39392
39393
39394
39395
39396
39397
39398
39399
39400
39401
39402
.....
40207
40208
40209
40210
40211
40212
40213
40214
40215
40216
40217
40218
40219
40220
40221
.....
41020
41021
41022
41023
41024
41025
41026
41027
41028
41029
41030
41031
41032
41033
41034
.....
41169
41170
41171
41172
41173
41174
41175
41176
41177
41178
41179
41180
41181
41182
41183
.....
42477
42478
42479
42480
42481
42482
42483
42484
42485
42486
42487
42488
42489
42490
42491
.....
44155
44156
44157
44158
44159
44160
44161
44162
44163
44164
44165
44166
44167
44168
44169
.....
46455
46456
46457
46458
46459
46460
46461
46462
46463
46464
46465
46466
46467
46468
46469
.....
46730
46731
46732
46733
46734
46735
46736
46737
46738
46739
46740
46741
46742
46743
46744
.....
47065
47066
47067
47068
47069
47070
47071
47072
47073
47074
47075
47076
47077
47078
47079
.....
47625
47626
47627
47628
47629
47630
47631
47632
47633
47634
47635
47636
47637
47638
47639
.....
47756
47757
47758
47759
47760
47761
47762
47763
47764
47765
47766
47767
47768
47769
47770
.....
48400
48401
48402
48403
48404
48405
48406
48407
48408
48409
48410
48411
48412
48413
48414
.....
49253
49254
49255
49256
49257
49258
49259
49260
49261
49262
49263
49264
49265
49266
49267
.....
50384
50385
50386
50387
50388
50389
50390
50391
50392
50393
50394
50395
50396
50397
50398
.....
52773
52774
52775
52776
52777
52778
52779
52780
52781
52782
52783
52784
52785
52786
52787
.....
58490
58491
58492
58493
58494
58495
58496
58497
58498
58499
58500
58501
58502
58503
58504
.....
59040
59041
59042
59043
59044
59045
59046
59047
59048
59049
59050
59051
59052
59053
59054
.....
61434
61435
61436
61437
61438
61439
61440
61441
61442
61443
61444
61445
61446
61447
61448
.....
61498
61499
61500
61501
61502
61503
61504
61505
61506
61507
61508
61509
61510
61511
61512
.....
62435
62436
62437
62438
62439
62440
62441
62442
62443
62444
62445
62446
62447
62448
62449
.....
64926
64927
64928
64929
64930
64931
64932
64933
64934
64935
64936
64937
64938
64939
64940
.....
69081
69082
69083
69084
69085
69086
69087
69088
69089
69090
69091
69092
69093
69094
69095
.....
71034
71035
71036
71037
71038
71039
71040
71041
71042
71043
71044
71045
71046
71047
71048
.....
71056
71057
71058
71059
71060
71061
71062
71063
71064
71065
71066
71067
71068
71069
71070
.....
71542
71543
71544
71545
71546
71547
71548
71549
71550
71551
71552
71553
71554
71555
71556
.....
72982
72983
72984
72985
72986
72987
72988
72989
72990
72991
72992
72993
72994
72995
72996
58

query I rowsort
SELECT DISTINCT 20 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
20

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( + 3, 40 * cor0.col0 ) AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
3
3
3

................................................................................
query I rowsort
SELECT 67 AS col0 FROM tab1 cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col0
----
67
67
67

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( 29, + tab1.col1 ) AS col0 FROM tab1, tab0 AS cor0, tab2 AS cor1 GROUP BY cor1.col2
----
29

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( - 85, + cor0.col2 + 58 ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
-85

query I rowsort
SELECT cor1.col0 AS col2 FROM tab2 AS cor0 CROSS JOIN tab1 cor1 GROUP BY cor1.col0, cor1.col1
................................................................................
query I rowsort
SELECT ALL - cor0.col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( cor0.col1 ) IS NULL
----
-41
-59
-61

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - + COALESCE ( - 95, + tab0.col0 ) AS col1 FROM tab0 GROUP BY tab0.col2
----
95

query I rowsort
SELECT DISTINCT + 4 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
................................................................................
query I rowsort label-549
SELECT COALESCE ( + 1, cor0.col0 ) + - CAST( NULL AS DECIMAL ) FROM tab1, tab0 AS cor0, tab1 AS cor1 GROUP BY cor0.col1
----
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-549
SELECT COALESCE ( + 1, cor0.col0 ) + - CAST ( NULL AS REAL ) FROM tab1, tab0 AS cor0, tab1 AS cor1 GROUP BY cor0.col1
----
NULL
NULL

query I rowsort
................................................................................
query I rowsort
SELECT ALL 47 FROM tab2, tab2 AS cor0 GROUP BY cor0.col0
----
47
47
47

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( 89, cor0.col1 * + cor0.col1 ) FROM tab0 cor0 GROUP BY cor0.col2, cor0.col2, cor0.col0
----
89
89
89

................................................................................
query I rowsort
SELECT DISTINCT + cor0.col0 * - 69 col0 FROM tab2, tab1 AS cor0, tab0 AS cor1 GROUP BY cor0.col0
----
-1518
-1932
-5658

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( - COALESCE ( + col0, tab1.col0 ), 76, + col1 ) AS col1 FROM tab1 GROUP BY col0
----
22
28
82

................................................................................
query I rowsort
SELECT + - 27 AS col1 FROM tab2 GROUP BY tab2.col1
----
-27
-27
-27

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - NULLIF ( + col2, cor0.col2 ) * - COALESCE ( 78, + cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL

................................................................................
query I rowsort label-932
SELECT ALL col1 / 39 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col1
----
0
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - CASE - cor0.col2 WHEN cor0.col2 THEN col2 ELSE cor0.col2 END col2 FROM tab1 cor0 GROUP BY cor0.col2
----
-45
-71
-8

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( - COALESCE ( 69, col2, + 41, cor0.col1 ), - cor0.col2, 80 ) * cor0.col0 + 76 FROM tab0 cor0 GROUP BY cor0.col2, cor0.col0
----
1870
3043
5803

................................................................................
query I rowsort
SELECT DISTINCT - 94 + - tab0.col2 FROM tab0 GROUP BY tab0.col2
----
-118
-132
-173

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( + COALESCE ( - 21, tab1.col0 ), + cor0.col0 ) * - cor0.col2 FROM tab1, tab2 AS cor0 GROUP BY cor0.col2
----
-1218
-1659
-1827

................................................................................
query I rowsort
SELECT ALL 14 * - COALESCE ( - 87, tab0.col2 ) AS col2 FROM tab0 GROUP BY tab0.col2
----
1218
1218
1218

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT CASE - 75 WHEN - 96 THEN - cor0.col1 * - ( cor0.col0 ) WHEN cor0.col0 THEN NULL END FROM tab1 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

................................................................................

query I rowsort
SELECT ALL - 42 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
-42
-42

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL COALESCE ( 72, + cor0.col2 + - 8 ) FROM tab1 cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor0.col0
----
72
72
72

................................................................................
query I rowsort
SELECT ( - cor0.col1 ) + + 59 * + cor0.col1 + 1 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
2553
3307
349

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + cor0.col1, 84, cor0.col0 + cor0.col2 ) * - 62 AS col0 FROM tab2 cor0 GROUP BY cor0.col1
----
-2542
-3658
-3782

................................................................................
query I rowsort
SELECT ALL 35 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
35
35
35

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - + COALESCE ( + 64, + col2 ) + + tab0.col0 FROM tab0 GROUP BY tab0.col0
----
-21
-38
19

................................................................................
query I rowsort
SELECT + 3 FROM tab2, tab1 AS cor0 GROUP BY tab2.col0
----
3
3
3

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + 55, - tab0.col2 + + tab0.col2 ) FROM tab0 GROUP BY tab0.col1
----
55
55

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - COALESCE ( + 57, + cor0.col2 * cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col1
----
-57
-57

query I rowsort
................................................................................
query I rowsort
SELECT + + cor0.col2 * cor0.col2 + - 4 FROM tab1, tab0 cor0 GROUP BY cor0.col2
----
1440
572
6237

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( 47, - 49 * cor0.col1, col0 * cor0.col1, + col2 + cor0.col0 * - cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
47
47
47

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( - 22, col2 ) FROM tab2 GROUP BY col1
----
-22
-22
-22

................................................................................
query I rowsort
SELECT + 80 FROM tab1 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col2
----
80
80
80

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - CASE - cor0.col1 WHEN COALESCE ( + 63, cor0.col2 * col2 ) + cor0.col1 THEN cor0.col1 END AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
NULL

query I rowsort
SELECT - 40 FROM tab1 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor0.col1
................................................................................
SELECT ALL COALESCE ( 57, - col2 DIV col0 + + ( 49 ) * cor0.col1 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col0
----
57
57
57

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-2339
SELECT ALL COALESCE ( 57, - col2 / col0 + + ( 49 ) * cor0.col1 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col0
----
57
57
57

................................................................................
query I rowsort label-2404
SELECT DISTINCT - cor0.col0 DIV - 73 + COALESCE ( 83, + cor0.col0 + + cor0.col2, cor0.col2 * - cor0.col0 - - cor0.col2 ) FROM tab1 cor0 GROUP BY cor0.col0
----
83
84

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-2404
SELECT DISTINCT - cor0.col0 / - 73 + COALESCE ( 83, + cor0.col0 + + cor0.col2, cor0.col2 * - cor0.col0 - - cor0.col2 ) FROM tab1 cor0 GROUP BY cor0.col0
----
83
84

query I rowsort
................................................................................
query I rowsort label-2446
SELECT - 91 / 55 + + cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
25
42
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL COALESCE ( - 13, + cor1.col2, - cor1.col2 ) FROM tab0 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor1.col1
----
-13
-13

query I rowsort
................................................................................
onlyif mysql # DIV for integer division: 
query I rowsort label-2470
SELECT DISTINCT + COALESCE ( + 98, cor0.col2, + cor0.col2 DIV 71 + col1 * - cor0.col2 ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
98

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-2470
SELECT DISTINCT + COALESCE ( + 98, cor0.col2, + cor0.col2 / 71 + col1 * - cor0.col2 ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
98

query I rowsort
SELECT DISTINCT 73 * - cor0.col0 AS col0 FROM tab1 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor0.col0, cor1.col1, cor1.col0
................................................................................
-700

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( + 75, - cor0.col2 + - cor0.col0, + cor0.col2 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
75

query I rowsort
SELECT - 65 * 90 AS col1 FROM tab1 cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT ALL - COALESCE ( tab0.col0, tab0.col0 * tab0.col0 ) FROM tab0 GROUP BY tab0.col0
----
-26
-43
-83

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 30, cor0.col1 * - cor0.col1, NULLIF ( - cor0.col2, - cor0.col1 * - CASE - col0 WHEN cor0.col2 THEN cor0.col2 WHEN - ( 78 ) THEN cor0.col0 * - cor0.col0 ELSE NULL END + cor0.col0 * cor0.col2 ) ) AS col1 FROM tab1 cor0 GROUP BY cor0.col2, cor0.col0
----
30
30
30

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( - 43, + cor0.col1 - + cor0.col2, + 80 + + cor0.col1 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-43

query I rowsort
SELECT DISTINCT ( 10 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT ALL + tab2.col0 * + 25 FROM tab2 GROUP BY tab2.col0
----
2275
2300
375

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col2 * COALESCE ( - 62 * - 77, col0 + NULLIF ( cor0.col1 - cor0.col0, - col0 - - cor0.col1 ) ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
276892
377146
415338

................................................................................
onlyif mysql # DIV for integer division: 
query I rowsort label-3085
SELECT DISTINCT COALESCE ( + 5, cor0.col2 + - col2, cor0.col0 * - cor0.col0, cor0.col0 DIV 56 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
5

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3085
SELECT DISTINCT COALESCE ( + 5, cor0.col2 + - col2, cor0.col0 * - cor0.col0, cor0.col0 / 56 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
5

query I rowsort
SELECT DISTINCT + + 73 FROM tab1 GROUP BY tab1.col0
................................................................................
query I rowsort
SELECT + 30 * cor0.col2 + cor0.col1 * NULLIF ( + cor0.col2, cor0.col2 * 58 ) FROM tab0 AS cor0 GROUP BY col1, cor0.col2
----
1140
2370
2664

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 3, - cor0.col1 * + cor0.col1, 76, + cor0.col0 * 65 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
3
3
3

................................................................................

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT cor0.col2 + - cor0.col0 * + NULLIF ( COALESCE ( cor0.col2, - 37, + ( - cor0.col0 ) + cor0.col1 ) - + 9, - 15 ) AS col0 FROM tab0 cor0 GROUP BY cor0.col0, cor0.col2
----
-1741
-2369
-621

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( - 98, + cor0.col2 + cor0.col1, col1 + + cor0.col2, - cor0.col1 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-98

query I rowsort
SELECT DISTINCT + 57 FROM tab0 GROUP BY tab0.col1
................................................................................
query I rowsort
SELECT ALL + 43 FROM tab2 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col2, cor0.col0
----
43
43
43

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT cor0.col2 * COALESCE ( + 40, + cor0.col0 + cor0.col0 ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
2320
3160
3480

................................................................................
SELECT ALL + ( + COALESCE ( 27, cor0.col2 DIV cor0.col1, - 39 + cor0.col0 ) ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
27
27
27

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3616
SELECT ALL + ( + COALESCE ( 27, cor0.col2 / cor0.col1, - 39 + cor0.col0 ) ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1
----
27
27
27

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( 74, - cor0.col2, - cor0.col0 * cor0.col2 ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
74
74
74

................................................................................
SELECT COALESCE ( 51, - col0 + - cor0.col1, - CASE - cor0.col1 WHEN + cor0.col1 + - 44 THEN NULL WHEN cor0.col2 THEN + cor0.col1 + - CASE + COALESCE ( + col0, - col1 ) WHEN COALESCE ( + cor0.col1, cor0.col0 / CAST( 7 AS SIGNED ) ) * + cor0.col1 THEN + cor0.col0 END * - cor0.col0 WHEN cor0.col1 THEN NULL WHEN cor0.col0 THEN NULL END ) * 78 FROM tab2 cor0 GROUP BY cor0.col2
----
3978
3978
3978

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3865
SELECT COALESCE ( 51, - col0 + - cor0.col1, - CASE - cor0.col1 WHEN + cor0.col1 + - 44 THEN NULL WHEN cor0.col2 THEN + cor0.col1 + - CASE + COALESCE ( + col0, - col1 ) WHEN COALESCE ( + cor0.col1, cor0.col0 / CAST ( 7 AS INTEGER ) ) * + cor0.col1 THEN + cor0.col0 END * - cor0.col0 WHEN cor0.col1 THEN NULL WHEN cor0.col0 THEN NULL END ) * 78 FROM tab2 cor0 GROUP BY cor0.col2
----
3978
3978
3978

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( - 38, cor0.col2, col1 + 90 * + cor0.col1 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
-38
-38
-38

................................................................................
query I rowsort
SELECT + 55 AS col0 FROM tab2 GROUP BY tab2.col0
----
55
55
55

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( - 85, + cor0.col2 + + 3 * + cor0.col0, 58, + cor0.col1 + ( cor0.col2 - cor0.col0 ) ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
-85

query I rowsort
SELECT DISTINCT - cor1.col1 FROM tab2 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor0.col1, cor1.col1
................................................................................
SELECT COALESCE ( 76, - tab1.col1 DIV - col0 ) FROM tab1 GROUP BY tab1.col1
----
76
76
76

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4068
SELECT COALESCE ( 76, - tab1.col1 / - col0 ) FROM tab1 GROUP BY tab1.col1
----
76
76
76

................................................................................
SELECT + cor0.col0 DIV + COALESCE ( - 39, cor0.col2 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-2
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4069
SELECT + cor0.col0 / + COALESCE ( - 39, cor0.col2 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-2
0
0

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT CASE col2 WHEN + 52 THEN - 52 * cor0.col2 END col0 FROM tab1 cor0 GROUP BY col2, cor0.col2
----
NULL
NULL
NULL

................................................................................
query I rowsort
SELECT ALL - cor0.col0 FROM tab0 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor0.col0
----
-26
-43
-83

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT ( - COALESCE ( + 12, - tab2.col1 ) ) FROM tab2 GROUP BY col2
----
-12

query I rowsort
SELECT - 65 AS col0 FROM tab2 GROUP BY tab2.col0
................................................................................
83

query I rowsort
SELECT cor0.col2 AS col2 FROM tab1 AS cor0 CROSS JOIN tab2 cor1 GROUP BY cor1.col0, cor0.col2
----
9 values hashing to 66267ca705f58a4488972e09499aeb2b

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - CASE cor0.col2 WHEN cor0.col2 THEN col2 ELSE cor0.col2 END col2 FROM tab1 cor0 GROUP BY cor0.col2
----
-45
-71
-8

................................................................................
-64

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( 32, - cor0.col2 * cor0.col1, + cor0.col0 ) FROM tab1 AS cor0 GROUP BY col0
----
32
32
32

................................................................................
query I rowsort
SELECT - 93 + 49 FROM tab2 GROUP BY tab2.col2
----
-44
-44
-44

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 62, cor0.col1 ) AS col2 FROM tab0 cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor1.col0
----
62
62
62

................................................................................
query I rowsort
SELECT ALL - 78 FROM tab0 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor1.col0
----
-78
-78
-78

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 29, - col1 + NULLIF ( + cor0.col0 + - 92, - cor0.col1 ) * 75, + 9, + cor0.col1 + + cor0.col0 ) + + cor0.col1 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
110
29

skipif postgresql # PostgreSQL requires AS when renaming output columns
................................................................................
query I rowsort
SELECT ALL 57 * - 24 FROM tab1 AS cor0 GROUP BY cor0.col0
----
-1368
-1368
-1368

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( - 54, cor0.col0 + - cor0.col1 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-54
-54
-54

................................................................................
SELECT DISTINCT - cor0.col2 * CASE 41 WHEN + 82 THEN col1 DIV 13 ELSE 38 END AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-1710
-2698
-304

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4254
SELECT DISTINCT - cor0.col2 * CASE 41 WHEN + 82 THEN col1 / 13 ELSE 38 END AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-1710
-2698
-304

................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4268
SELECT DISTINCT COALESCE ( - 46, cor0.col1, + cor0.col2, cor0.col2 * cor0.col1 - + col0 ) * + CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4268
SELECT DISTINCT COALESCE ( - 46, cor0.col1, + cor0.col2, cor0.col2 * cor0.col1 - + col0 ) * + CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
NULL

query I rowsort
SELECT ALL + cor0.col0 AS col0 FROM tab1, tab2 AS cor0 GROUP BY cor0.col0
................................................................................
query I rowsort
SELECT - 13 FROM tab0 GROUP BY tab0.col2
----
-13
-13
-13

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT CASE 75 WHEN - 96 THEN - cor0.col1 * - ( cor0.col0 ) WHEN cor0.col0 THEN NULL END FROM tab1 AS cor0 GROUP BY cor0.col0
----
NULL
NULL
NULL

................................................................................
query I rowsort
SELECT 63 * col0 FROM tab1 GROUP BY col0
----
1386
1764
5166

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + 47, col2 ) AS col2 FROM tab0 GROUP BY tab0.col1
----
47
47

query I rowsort
................................................................................
query I rowsort
SELECT ALL cor0.col0 + 76 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col0
----
104
158
98

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( 11, + cor0.col0 * cor0.col2 ) FROM tab1 AS cor0 GROUP BY col2
----
-11

query I rowsort
SELECT cor0.col1 * - cor0.col0 FROM tab0 cor0 GROUP BY cor0.col0, cor0.col1
................................................................................

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 96, - cor0.col2 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
96
96

query I rowsort
................................................................................
query I rowsort
SELECT ALL 52 AS col2 FROM tab2 GROUP BY tab2.col2
----
52
52
52

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL COALESCE ( 63, col2, cor0.col2 * + cor0.col0 + cor0.col0 * cor0.col1 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col0
----
63
63
63

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT tab1.col1 AS col2 FROM tab1 GROUP BY tab1.col1 HAVING NULL NOT IN ( col2 )
----

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

query I rowsort
SELECT DISTINCT 65 AS col2 FROM tab2 GROUP BY tab2.col0
----
65

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + CASE col2 WHEN + cor0.col1 + - 18 THEN NULL ELSE col1 END col0 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col2
----
44
57
6

................................................................................
query I rowsort
SELECT - 7 * 50 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-350
-350
-350

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( - 60, - cor0.col2 ) + - 72 * 82 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-5964
-5964
-5964

................................................................................
query I rowsort
SELECT 16 FROM tab0 cor0 GROUP BY cor0.col2, cor0.col2
----
16
16
16

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - COALESCE ( 19, cor0.col1 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
-19
-19
-19

................................................................................
query I rowsort
SELECT ALL - col0 * ( - 87 ) + + 89 col2 FROM tab2 cor0 GROUP BY cor0.col0
----
1394
8006
8093

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( 90, cor1.col1 + 31 ) FROM tab2 AS cor0 CROSS JOIN tab2 cor1 GROUP BY cor1.col0, cor0.col1
----
9 values hashing to f6f26b9a04da14807208b93d507095c5

query I rowsort
SELECT DISTINCT - 52 - cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2, col1, col0
................................................................................
51

query I rowsort
SELECT DISTINCT 69 + 36 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
105

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( + 39, col1 + - 65 ) FROM tab2 AS cor0 GROUP BY col2, cor0.col2
----
-39
-39
-39

................................................................................
-79

query I rowsort
SELECT DISTINCT 36 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
----
36

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + NULLIF ( COALESCE ( cor0.col0, 94, cor0.col1 * cor0.col0 + + cor0.col0 * 33 ), + 90 ) FROM tab2 AS cor0 GROUP BY cor0.col0, col0
----
15
91
92

................................................................................
query I rowsort
SELECT + 13 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col0
----
13
13
13

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( + 26, + cor0.col1, + 66, + col2 ) FROM tab2 AS cor0 GROUP BY col1
----
26
26
26

................................................................................
query I rowsort
SELECT ALL 84 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
84
84
84

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( + 11, cor0.col1 + + cor0.col2, 62 ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
-11
-11
-11

................................................................................
query I rowsort
SELECT ALL 85 FROM tab1 AS cor0 GROUP BY cor0.col2
----
85
85
85

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT 66 + COALESCE ( + 68, + cor0.col2 * + 81 ) FROM tab1 AS cor0 GROUP BY col1
----
134
134
134

................................................................................
onlyif mysql # DIV for integer division: 
query I rowsort label-6014
SELECT DISTINCT + COALESCE ( 96, col0, cor0.col1 + cor0.col2 DIV - cor0.col0 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
96

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6014
SELECT DISTINCT + COALESCE ( 96, col0, cor0.col1 + cor0.col2 / - cor0.col0 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
----
96

query I rowsort
SELECT + 79 FROM tab2 cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT 91 - cor0.col0 FROM tab0 cor0 GROUP BY cor0.col0
----
48
65
8

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( - 71, cor0.col2 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-71
-71
-71

................................................................................
query I rowsort
SELECT DISTINCT - cor0.col0 * + COALESCE ( 19, - col0 * + cor0.col0 + cor0.col1, cor0.col1 ) FROM tab0 AS cor0 GROUP BY col0, cor0.col1
----
-1577
-494
-817

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( - 92, - cor0.col2 ) FROM tab0 AS cor0 GROUP BY cor0.col1
----
-92
-92

query I rowsort
................................................................................
query I rowsort
SELECT ( COALESCE ( - cor0.col0, 56 + + cor0.col0 ) ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
-15
-91
-92

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( + 98, cor0.col1, cor0.col2 * - 54, 94 - - cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col1, col0
----
98

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( - 20, cor0.col2 ) FROM tab0 AS cor0 GROUP BY cor0.col1
----
-20
-20

query I rowsort
................................................................................
0

query I rowsort
SELECT DISTINCT 89 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
89

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - + COALESCE ( 91, tab0.col2 ) * 85 FROM tab0 GROUP BY tab0.col0
----
-7735

query I rowsort
SELECT ALL + 7 + cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
................................................................................
query I rowsort label-6590
SELECT ALL + 65 / - 76 AS col2 FROM tab0, tab2 cor0 GROUP BY cor0.col2
----
0
0
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT cor0.col0 + COALESCE ( + ( 74 ), - cor0.col0 * 18, + cor0.col0 + + cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
165
166
89

................................................................................
query I rowsort label-6699
SELECT DISTINCT - - COALESCE ( col1, CAST( + 52 AS SIGNED ) + 63, + tab0.col0 * tab0.col0 ) FROM tab0 GROUP BY col1
----
0
81

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6699
SELECT DISTINCT - - COALESCE ( col1, CAST ( + 52 AS INTEGER ) + 63, + tab0.col0 * tab0.col0 ) FROM tab0 GROUP BY col1
----
0
81

onlyif mysql # DIV for integer division: 
................................................................................
query I rowsort label-6852
SELECT ALL + cor0.col2 / cor0.col2 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
1
1
1

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL COALESCE ( 94, col0 * - CASE - cor0.col2 WHEN col2 + cor0.col2 * cor0.col1 THEN NULL WHEN + col2 THEN NULL ELSE - cor0.col2 END - col2 ) * cor0.col2 + cor0.col2 * cor0.col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
13667
15747
8816

................................................................................

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL COALESCE ( - 16, cor0.col1 * cor0.col2 ) AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-16
-16
-16

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL COALESCE ( + 24, col0 * cor0.col2 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col0
----
24
24
24

................................................................................

query I rowsort
SELECT 26 FROM tab0 GROUP BY col1
----
26
26

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( - 67, + cor0.col1 * col0 ) FROM tab0 AS cor0 GROUP BY cor0.col2
----
-67
-67
-67

................................................................................
query I rowsort
SELECT DISTINCT + cor0.col0 * 33 - cor0.col0 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
1376
2656
832

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( 40, - cor0.col1 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-40
-40
-40

................................................................................
query I rowsort
SELECT DISTINCT col2 * + 77 FROM tab2 GROUP BY col2
----
4466
6083
6699

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( - 94, - cor0.col1 * cor0.col2 ) FROM tab2 AS cor0 GROUP BY cor0.col2, col0
----
-94
-94
-94

................................................................................
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-8479
SELECT ALL - 25 / 28 col1 FROM tab0 GROUP BY tab0.col1
----
0
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( 93, cor0.col1, 38 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-93
-93
-93

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( - 22, - tab1.col0 * 21 ) * 21 FROM tab1 GROUP BY tab1.col1
----
462
462
462

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + 29, cor0.col0, + cor0.col2 * cor0.col1 - + cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
29
29
29

................................................................................
query I rowsort
SELECT ALL - 87 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-87
-87
-87

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + 42, col2 + cor0.col2 * col0 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
42
42
42

................................................................................
query I rowsort
SELECT 32 AS col0 FROM tab2 cor0 GROUP BY cor0.col1
----
32
32
32

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - COALESCE ( 57, cor0.col0, COALESCE ( CASE col0 WHEN - col0 THEN NULL WHEN cor0.col0 * cor0.col2 THEN NULL WHEN + col0 THEN - cor0.col1 END, - 93, cor0.col2 ) ) + + col2 * - cor0.col2 AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-121
-2082
-5098

................................................................................
81

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( 71, cor0.col2 + - cor0.col2 ) FROM tab2 AS cor0 GROUP BY cor0.col1
----
71

query I rowsort
SELECT ALL + col0 AS col0 FROM tab1 GROUP BY col0
................................................................................
SELECT + COALESCE ( 21, + cor0.col0, - CAST( NULL AS SIGNED ), cor0.col2 + cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
21
21
21

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-9945
SELECT + COALESCE ( 21, + cor0.col0, - CAST ( NULL AS INTEGER ), cor0.col2 + cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
21
21
21

Changes to test/random/groupby/slt_good_10.test.

313
314
315
316
317
318
319

320
321
322
323
324
325
326
....
1176
1177
1178
1179
1180
1181
1182

1183
1184
1185
1186
1187
1188
1189
....
1248
1249
1250
1251
1252
1253
1254

1255
1256
1257
1258
1259
1260
1261
....
1556
1557
1558
1559
1560
1561
1562

1563
1564
1565
1566
1567
1568
1569
....
1601
1602
1603
1604
1605
1606
1607

1608
1609
1610
1611
1612
1613
1614
....
2148
2149
2150
2151
2152
2153
2154

2155
2156
2157
2158
2159
2160
2161
....
2496
2497
2498
2499
2500
2501
2502

2503
2504
2505
2506
2507
2508
2509
....
2852
2853
2854
2855
2856
2857
2858

2859
2860
2861
2862
2863
2864
2865
....
3453
3454
3455
3456
3457
3458
3459

3460
3461
3462
3463
3464
3465
3466
....
3681
3682
3683
3684
3685
3686
3687

3688
3689
3690
3691
3692
3693
3694
....
4135
4136
4137
4138
4139
4140
4141

4142
4143
4144
4145
4146
4147
4148
....
6769
6770
6771
6772
6773
6774
6775

6776
6777
6778
6779
6780
6781
6782
....
7210
7211
7212
7213
7214
7215
7216

7217
7218
7219
7220
7221
7222
7223
....
7259
7260
7261
7262
7263
7264
7265

7266
7267
7268
7269
7270
7271
7272
....
7605
7606
7607
7608
7609
7610
7611

7612
7613
7614
7615
7616
7617
7618
....
7694
7695
7696
7697
7698
7699
7700

7701
7702
7703
7704
7705
7706
7707
....
8575
8576
8577
8578
8579
8580
8581

8582
8583
8584
8585
8586
8587
8588
....
8673
8674
8675
8676
8677
8678
8679

8680
8681
8682
8683
8684
8685
8686
....
9071
9072
9073
9074
9075
9076
9077

9078
9079
9080
9081
9082
9083
9084
....
9085
9086
9087
9088
9089
9090
9091

9092
9093
9094
9095
9096
9097
9098
.....
11132
11133
11134
11135
11136
11137
11138

11139
11140
11141
11142
11143
11144
11145
.....
12039
12040
12041
12042
12043
12044
12045

12046
12047
12048
12049
12050
12051
12052
.....
12963
12964
12965
12966
12967
12968
12969

12970
12971
12972
12973
12974
12975
12976
.....
13182
13183
13184
13185
13186
13187
13188

13189
13190
13191
13192
13193
13194
13195
.....
13204
13205
13206
13207
13208
13209
13210

13211
13212
13213
13214
13215
13216
13217
.....
13474
13475
13476
13477
13478
13479
13480

13481
13482
13483
13484
13485
13486
13487
.....
14440
14441
14442
14443
14444
14445
14446

14447
14448
14449
14450
14451
14452
14453
.....
14864
14865
14866
14867
14868
14869
14870

14871
14872
14873
14874
14875
14876
14877
.....
14886
14887
14888
14889
14890
14891
14892

14893
14894
14895
14896
14897
14898
14899
.....
17926
17927
17928
17929
17930
17931
17932

17933
17934
17935
17936
17937
17938
17939
.....
19568
19569
19570
19571
19572
19573
19574

19575
19576
19577
19578
19579
19580
19581
.....
19801
19802
19803
19804
19805
19806
19807

19808
19809
19810
19811
19812
19813
19814
.....
20229
20230
20231
20232
20233
20234
20235

20236
20237
20238
20239
20240
20241
20242
.....
21675
21676
21677
21678
21679
21680
21681

21682
21683
21684
21685
21686
21687
21688
.....
22968
22969
22970
22971
22972
22973
22974

22975
22976
22977
22978
22979
22980
22981
.....
23547
23548
23549
23550
23551
23552
23553

23554
23555
23556
23557
23558
23559
23560
.....
24845
24846
24847
24848
24849
24850
24851

24852
24853
24854
24855
24856
24857
24858
.....
25038
25039
25040
25041
25042
25043
25044

25045
25046
25047
25048
25049
25050
25051
.....
25369
25370
25371
25372
25373
25374
25375

25376
25377
25378
25379
25380
25381
25382
.....
25850
25851
25852
25853
25854
25855
25856

25857
25858
25859
25860
25861
25862
25863
.....
25892
25893
25894
25895
25896
25897
25898

25899
25900
25901
25902
25903
25904
25905
.....
28573
28574
28575
28576
28577
28578
28579

28580
28581
28582
28583
28584
28585
28586
.....
28936
28937
28938
28939
28940
28941
28942

28943
28944
28945
28946
28947
28948
28949
.....
29080
29081
29082
29083
29084
29085
29086

29087
29088
29089
29090
29091
29092
29093
.....
29620
29621
29622
29623
29624
29625
29626

29627
29628
29629
29630
29631
29632
29633
.....
34686
34687
34688
34689
34690
34691
34692

34693
34694
34695
34696
34697
34698
34699
.....
36290
36291
36292
36293
36294
36295
36296

36297
36298
36299
36300
36301
36302
36303
.....
36528
36529
36530
36531
36532
36533
36534

36535
36536
36537
36538
36539
36540
36541
.....
37759
37760
37761
37762
37763
37764
37765

37766
37767
37768
37769
37770
37771
37772
.....
39114
39115
39116
39117
39118
39119
39120

39121
39122
39123
39124
39125
39126
39127
.....
39260
39261
39262
39263
39264
39265
39266

39267
39268
39269
39270
39271
39272
39273
.....
41633
41634
41635
41636
41637
41638
41639

41640
41641
41642
41643
41644
41645
41646
.....
41933
41934
41935
41936
41937
41938
41939

41940
41941
41942
41943
41944
41945
41946
.....
42040
42041
42042
42043
42044
42045
42046

42047
42048
42049
42050
42051
42052
42053
.....
42088
42089
42090
42091
42092
42093
42094

42095
42096
42097
42098
42099
42100
42101
.....
42108
42109
42110
42111
42112
42113
42114

42115
42116
42117
42118
42119
42120
42121
.....
42516
42517
42518
42519
42520
42521
42522

42523
42524
42525
42526
42527
42528
42529
.....
42595
42596
42597
42598
42599
42600
42601

42602
42603
42604
42605
42606
42607
42608
.....
42737
42738
42739
42740
42741
42742
42743

42744
42745
42746
42747
42748
42749
42750
.....
43865
43866
43867
43868
43869
43870
43871

43872
43873
43874
43875
43876
43877
43878
.....
44138
44139
44140
44141
44142
44143
44144

44145
44146
44147
44148
44149
44150
44151
.....
44347
44348
44349
44350
44351
44352
44353

44354
44355
44356
44357
44358
44359
44360
.....
44683
44684
44685
44686
44687
44688
44689

44690
44691
44692
44693
44694
44695
44696
.....
45662
45663
45664
45665
45666
45667
45668

45669
45670
45671
45672
45673
45674
45675
.....
46485
46486
46487
46488
46489
46490
46491

46492
46493
46494
46495
46496
46497
46498
.....
47108
47109
47110
47111
47112
47113
47114

47115
47116
47117
47118
47119
47120
47121
.....
48392
48393
48394
48395
48396
48397
48398

48399
48400
48401
48402
48403
48404
48405
.....
50080
50081
50082
50083
50084
50085
50086

50087
50088
50089
50090
50091
50092
50093
50094
50095
50096
50097
50098

50099
50100
50101
50102
50103
50104
50105
.....
50316
50317
50318
50319
50320
50321
50322

50323
50324
50325
50326
50327
50328
50329
.....
51329
51330
51331
51332
51333
51334
51335

51336
51337
51338
51339
51340
51341
51342
.....
51412
51413
51414
51415
51416
51417
51418

51419
51420
51421
51422
51423
51424
51425
.....
51727
51728
51729
51730
51731
51732
51733

51734
51735
51736
51737
51738
51739
51740
.....
52725
52726
52727
52728
52729
52730
52731

52732
52733
52734
52735
52736
52737
52738
.....
53326
53327
53328
53329
53330
53331
53332

53333
53334
53335
53336
53337
53338
53339
.....
53515
53516
53517
53518
53519
53520
53521

53522
53523
53524
53525
53526
53527
53528
.....
53762
53763
53764
53765
53766
53767
53768

53769
53770
53771
53772
53773
53774
53775
.....
54103
54104
54105
54106
54107
54108
54109

54110
54111
54112
54113
54114
54115
54116
.....
54844
54845
54846
54847
54848
54849
54850

54851
54852
54853
54854
54855
54856
54857
.....
55015
55016
55017
55018
55019
55020
55021

55022
55023
55024
55025
55026
55027
55028
.....
55164
55165
55166
55167
55168
55169
55170

55171
55172
55173
55174
55175
55176
55177
.....
55688
55689
55690
55691
55692
55693
55694

55695
55696
55697
55698
55699
55700
55701
.....
56409
56410
56411
56412
56413
56414
56415

56416
56417
56418
56419
56420
56421
56422
.....
56548
56549
56550
56551
56552
56553
56554

56555
56556
56557
56558
56559
56560
56561
.....
57391
57392
57393
57394
57395
57396
57397

57398
57399
57400
57401
57402
57403
57404
.....
58432
58433
58434
58435
58436
58437
58438

58439
58440
58441
58442
58443
58444
58445
.....
58848
58849
58850
58851
58852
58853
58854

58855
58856
58857
58858
58859
58860
58861
.....
58949
58950
58951
58952
58953
58954
58955

58956
58957
58958
58959
58960
58961
58962
.....
59501
59502
59503
59504
59505
59506
59507

59508
59509
59510
59511
59512
59513
59514
.....
59606
59607
59608
59609
59610
59611
59612

59613
59614
59615
59616
59617
59618
59619
.....
61427
61428
61429
61430
61431
61432
61433

61434
61435
61436
61437
61438
61439
61440
.....
61671
61672
61673
61674
61675
61676
61677

61678
61679
61680
61681
61682
61683
61684
.....
62497
62498
62499
62500
62501
62502
62503

62504
62505
62506
62507
62508
62509
62510
.....
62879
62880
62881
62882
62883
62884
62885

62886
62887
62888
62889
62890
62891
62892
.....
63256
63257
63258
63259
63260
63261
63262

63263
63264
63265
63266
63267
63268
63269
.....
63963
63964
63965
63966
63967
63968
63969

63970
63971
63972
63973
63974
63975
63976
.....
64006
64007
64008
64009
64010
64011
64012

64013
64014
64015
64016
64017
64018
64019
.....
64336
64337
64338
64339
64340
64341
64342

64343
64344
64345
64346
64347
64348
64349
.....
64478
64479
64480
64481
64482
64483
64484

64485
64486
64487
64488
64489
64490
64491
SELECT ALL - AVG ( DISTINCT col0 ) FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

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


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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab0 GROUP BY col0, col1
................................................................................
query I rowsort
SELECT ALL col1 + + col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
114
12
88


query II rowsort
SELECT ALL col0 col0, col0 FROM tab2 GROUP BY col1, col0
----
15
15
91
91
................................................................................
query I rowsort
SELECT DISTINCT + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83


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

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


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

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

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


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


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

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


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

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


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


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


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

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 WHERE NULL < - col1 * - col1 GROUP BY col1
----
................................................................................
query I rowsort
SELECT - col0 + - - col0 AS col1 FROM tab0 GROUP BY col0, col0
----
0
0
0


query II rowsort
SELECT - col1 + col1 col2, col1 * AVG ( ALL + col1 ) FROM tab1 GROUP BY col1, col1 HAVING NOT NULL BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col0, col2, col0
----
................................................................................
query I rowsort
SELECT + col2 - - col2 + - col1 FROM tab1 GROUP BY col2, col1
----
10
33
98


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

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


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


query II rowsort
SELECT col0 col2, col0 + - col0 AS col1 FROM tab1 GROUP BY col0
----
22
0
28
0
................................................................................
query I rowsort
SELECT - col1 * + - col1 + + col1 FROM tab2 GROUP BY col1
----
1722
3540
3782


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

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

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


query II rowsort
SELECT DISTINCT col2 col1, - col2 FROM tab0 AS cor0 GROUP BY col2
----
24
-24
38
-38
................................................................................
query I rowsort label-1307
SELECT - - col1 / + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1


query II rowsort
SELECT DISTINCT col1 col0, col2 FROM tab1 GROUP BY col1, col2
----
44
71
57
45
................................................................................
79
87

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


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


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

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


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

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


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

query I rowsort
SELECT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT AVG ( DISTINCT - col2 ) IS NULL
----
................................................................................
query I rowsort
SELECT + col0 * col0 FROM tab1 GROUP BY col0
----
484
6724
784


query I rowsort
SELECT + + col2 AS col1 FROM tab2 WHERE - + col1 IS NOT NULL GROUP BY col2 HAVING ( NULL ) <> col1
----

query II rowsort
SELECT col0 AS col1, col0 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
................................................................................
-38
-79

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


query II rowsort
SELECT col1 col1, col0 FROM tab2 GROUP BY col0, col2, col1
----
41
92
59
91
................................................................................
query I rowsort
SELECT ALL col0 * + col0 FROM tab1 GROUP BY col0
----
484
6724
784


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

query I rowsort
SELECT col2 FROM tab0 cor0 WHERE NOT NULL IS NULL GROUP BY col2
----
................................................................................
query I rowsort
SELECT col0 FROM tab1 GROUP BY col1, col1, col0
----
22
28
82


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

query II rowsort
SELECT col0, - col0 FROM tab2 GROUP BY col0
----
................................................................................
query I rowsort
SELECT DISTINCT col0 * col0 col0 FROM tab0 GROUP BY col0
----
1849
676
6889


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

query I rowsort
SELECT ALL + col0 - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
................................................................................
SELECT col0 FROM tab0 GROUP BY col0 HAVING - col0 <> NULL
----

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


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

query I rowsort
SELECT col0 * + col0 FROM tab2 GROUP BY col0, col2, col0
----
................................................................................
query I rowsort
SELECT ALL + col1 * col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
2378
4661
5307


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

query I rowsort
SELECT DISTINCT - + col2 * - col2 + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
................................................................................
-43
-83

query I rowsort
SELECT - col1 * - + col1 FROM tab0 GROUP BY col1, col0 HAVING ( - col1 ) > NULL
----


query II rowsort
SELECT col1 col1, - col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
44
-44
57
-57
................................................................................
query I rowsort
SELECT col0 FROM tab2 AS cor0 GROUP BY col1, col0, col0
----
15
91
92


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

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

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


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

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


query II rowsort
SELECT + col1 col1, + col2 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1, col2
----
44
71
57
45
................................................................................
query I rowsort
SELECT DISTINCT - col2 * col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-3364
-6241
-7569


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

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


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

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


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

query I rowsort
SELECT - col0 * + + col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
................................................................................
query I rowsort
SELECT - col2 + - col2 FROM tab2 GROUP BY col2, col0 HAVING NOT - col0 IS NULL
----
-116
-158
-174


query II rowsort
SELECT + + col0 + - - col0 col2, - col0 FROM tab0 AS cor0 GROUP BY col0
----
166
-83
52
-26
................................................................................
query I rowsort
SELECT + - col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-24
-38
-79


query II rowsort
SELECT DISTINCT col0 col2, + col0 AS col0 FROM tab2 GROUP BY col0, col0
----
15
15
91
91
................................................................................
SELECT ALL - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col2 HAVING NULL = - col0
----

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


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

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING + col2 IS NULL
----
................................................................................
3249
36

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND ( col2 )
----


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

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

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


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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab0 AS cor0 GROUP BY col1
................................................................................
query I rowsort
SELECT + col2 * col0 AS col1 FROM tab2 GROUP BY col2, col0
----
1305
5336
7189


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

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


query II rowsort
SELECT DISTINCT col0 col1, + col2 FROM tab1 GROUP BY col0, col2
----
22
8
28
45
................................................................................
query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2
----
-24
-38
-79


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

query I rowsort
SELECT DISTINCT col0 FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN NULL AND - AVG ( DISTINCT - col1 )
----
................................................................................
query I rowsort
SELECT ALL - col1 * - col1 AS col2 FROM tab1 GROUP BY col1
----
1936
3249
36


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

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----
................................................................................
query I rowsort
SELECT - + col0 - + col0 FROM tab0 AS cor0 GROUP BY col0
----
-166
-52
-86


query II rowsort
SELECT col2 col1, col2 FROM tab0 AS cor0 WHERE NOT - col0 IS NULL GROUP BY col2
----
24
24
38
38
................................................................................
query I rowsort
SELECT col0 + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
0
0
0


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


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

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

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


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

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----
................................................................................
59
61

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


query II rowsort
SELECT DISTINCT + col0 col0, col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
15
91
91
................................................................................
query I rowsort
SELECT ALL col2 col0 FROM tab2 cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87


query II rowsort
SELECT col2 col2, col2 AS col2 FROM tab2 GROUP BY col2
----
58
58
79
79
................................................................................
query I rowsort
SELECT DISTINCT - - col0 AS col1 FROM tab1 cor0 GROUP BY col0
----
22
28
82


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

query I rowsort
SELECT ALL - col1 * - + col1 AS col1 FROM tab1 GROUP BY col1, col1
----
................................................................................
-43
-83

query I rowsort
SELECT ALL + col0 FROM tab0 cor0 WHERE NOT NULL >= NULL GROUP BY col1, col0, col1
----


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


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

query I rowsort
SELECT DISTINCT + col2 * + col2 * + col2 FROM tab0 GROUP BY col2
----
................................................................................
SELECT ALL - col1 + - col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

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


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

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


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

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL NOT IN ( - AVG ( - col2 ) )
----
................................................................................
-71
-8

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


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

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

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


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

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


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

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


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

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

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


query II rowsort
SELECT DISTINCT + + col0 * + - col0 col1, - col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-22
-6724
-82
................................................................................
SELECT - + col0 FROM tab0 WHERE NOT NULL > NULL GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

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


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

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


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

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


query II rowsort
SELECT ALL col2 col2, col2 AS col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
24
24
38
38
................................................................................

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


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

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


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

query I rowsort
SELECT ALL col1 - + col2 FROM tab0 GROUP BY col2, col1
----
................................................................................
query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61


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

query I rowsort
SELECT ALL + col2 * + col0 AS col0 FROM tab1 GROUP BY col0, col2
----
................................................................................
6972
702

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


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

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


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

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


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

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----
................................................................................
43
83

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


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

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


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

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


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

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

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


query II rowsort
SELECT col0 col1, col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
15
15
91
91
................................................................................
SELECT + col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

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


query II rowsort
SELECT ALL + col2 col1, - col1 AS col0 FROM tab1 GROUP BY col2, col1
----
45
-57
71
-44
................................................................................
query I rowsort
SELECT DISTINCT col0 * col0 FROM tab2 GROUP BY col0
----
225
8281
8464


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


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

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 AS cor0 WHERE NOT NULL NOT BETWEEN + col0 AND col1 GROUP BY col2
----
................................................................................
query I rowsort
SELECT - + col1 AS col0 FROM tab2 WHERE NOT - col1 IS NULL GROUP BY col1, col1
----
-41
-59
-61


query II rowsort
SELECT DISTINCT col1 col2, - col1 AS col0 FROM tab2 GROUP BY col1
----
41
-41
59
-59
................................................................................
query I rowsort
SELECT DISTINCT + col0 col0 FROM tab1 AS cor0 WHERE - col2 IS NOT NULL GROUP BY col0
----
22
28
82


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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NULL
................................................................................
24
43
38
83
79
26


query II rowsort
SELECT ALL + col0 col2, col1 * - col1 AS col0 FROM tab2 GROUP BY col0, col1
----
15
-3721
91
-3481
................................................................................
0
81

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


query II rowsort
SELECT ALL + col0 AS col1, col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT + col2 BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT - + col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
................................................................................
query I rowsort
SELECT ALL + col2 - - + col2 + - - col2 FROM tab2 AS cor0 GROUP BY col2
----
174
237
261


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

query I rowsort
SELECT ALL + col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL > NULL
----
................................................................................
92

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


query III rowsort
SELECT - col2 col2, col2, col2 AS col1 FROM tab2 GROUP BY col2
----
9 values hashing to 0b557cf9945bfac98ef8ff910306a370

query I rowsort
SELECT + col0 * + - col0 + + col0 FROM tab1 GROUP BY col0
................................................................................
SELECT ALL - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING ( col2 ) IS NULL
----

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


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

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


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

query I rowsort
SELECT col2 + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
................................................................................
43
83

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


query II rowsort
SELECT DISTINCT - col1 col1, col1 + col1 * + col1 AS col0 FROM tab1 GROUP BY col2, col1
----
-44
1980
-57
3306
................................................................................
SELECT ALL col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + col2 < NULL
----

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


query II rowsort
SELECT DISTINCT col0 col2, col0 FROM tab2 GROUP BY col0, col1
----
15
15
91
91
................................................................................
query I rowsort
SELECT ALL + - col1 - - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL IS NULL )
----
0
0
0


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

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


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

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


query II rowsort
SELECT ALL - col2 col2, col2 AS col0 FROM tab2 GROUP BY col2
----
-58
58
-79
79
................................................................................
-3306
-42

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


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


query II rowsort
SELECT - col1 col2, col1 AS col1 FROM tab2 WHERE NOT ( + col1 ) IS NOT NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 cor0 GROUP BY col0, col0 HAVING + col0 IS NOT NULL
----
................................................................................
query I rowsort
SELECT - col0 - col0 FROM tab1 AS cor0 GROUP BY col0
----
-164
-44
-56


query II rowsort
SELECT - col2 col1, col2 AS col1 FROM tab2 GROUP BY col2
----
-58
58
-79
79
................................................................................
query I rowsort
SELECT - col0 AS col2 FROM tab1 cor0 GROUP BY col0, col2
----
-22
-28
-82


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

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


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

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

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


query II rowsort
SELECT + col2 col0, + col2 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
................................................................................
query I rowsort
SELECT - col0 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col0 HAVING NOT NULL IS NOT NULL
----
-22
-28
-82


query II rowsort
SELECT DISTINCT - col1 col0, col1 FROM tab1 AS cor0 GROUP BY col1
----
-44
44
-57
57
................................................................................
0
0

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


query II rowsort
SELECT DISTINCT + col1 col1, - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
41
-92
59
-91
................................................................................
query I rowsort
SELECT DISTINCT - col0 * + + col0 FROM tab1 GROUP BY col0
----
-484
-6724
-784


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

query I rowsort
SELECT DISTINCT col0 FROM tab1 cor0 WHERE NOT ( col0 ) <= NULL GROUP BY col2, col0, col1
----


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

query II rowsort
SELECT DISTINCT - col0 * + col0, + col0 FROM tab2 AS cor0 GROUP BY col0
----







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>












>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
....
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
....
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
....
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
....
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
....
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
....
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
....
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
....
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
....
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
....
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
....
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
....
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
....
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
....
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
....
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
....
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
....
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
....
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
....
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
.....
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
.....
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
.....
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
.....
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
.....
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
.....
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
.....
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
.....
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
.....
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
.....
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
.....
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
.....
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
.....
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
.....
21708
21709
21710
21711
21712
21713
21714
21715
21716
21717
21718
21719
21720
21721
21722
.....
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011
23012
23013
23014
23015
23016
.....
23582
23583
23584
23585
23586
23587
23588
23589
23590
23591
23592
23593
23594
23595
23596
.....
24881
24882
24883
24884
24885
24886
24887
24888
24889
24890
24891
24892
24893
24894
24895
.....
25075
25076
25077
25078
25079
25080
25081
25082
25083
25084
25085
25086
25087
25088
25089
.....
25407
25408
25409
25410
25411
25412
25413
25414
25415
25416
25417
25418
25419
25420
25421
.....
25889
25890
25891
25892
25893
25894
25895
25896
25897
25898
25899
25900
25901
25902
25903
.....
25932
25933
25934
25935
25936
25937
25938
25939
25940
25941
25942
25943
25944
25945
25946
.....
28614
28615
28616
28617
28618
28619
28620
28621
28622
28623
28624
28625
28626
28627
28628
.....
28978
28979
28980
28981
28982
28983
28984
28985
28986
28987
28988
28989
28990
28991
28992
.....
29123
29124
29125
29126
29127
29128
29129
29130
29131
29132
29133
29134
29135
29136
29137
.....
29664
29665
29666
29667
29668
29669
29670
29671
29672
29673
29674
29675
29676
29677
29678
.....
34731
34732
34733
34734
34735
34736
34737
34738
34739
34740
34741
34742
34743
34744
34745
.....
36336
36337
36338
36339
36340
36341
36342
36343
36344
36345
36346
36347
36348
36349
36350
.....
36575
36576
36577
36578
36579
36580
36581
36582
36583
36584
36585
36586
36587
36588
36589
.....
37807
37808
37809
37810
37811
37812
37813
37814
37815
37816
37817
37818
37819
37820
37821
.....
39163
39164
39165
39166
39167
39168
39169
39170
39171
39172
39173
39174
39175
39176
39177
.....
39310
39311
39312
39313
39314
39315
39316
39317
39318
39319
39320
39321
39322
39323
39324
.....
41684
41685
41686
41687
41688
41689
41690
41691
41692
41693
41694
41695
41696
41697
41698
.....
41985
41986
41987
41988
41989
41990
41991
41992
41993
41994
41995
41996
41997
41998
41999
.....
42093
42094
42095
42096
42097
42098
42099
42100
42101
42102
42103
42104
42105
42106
42107
.....
42142
42143
42144
42145
42146
42147
42148
42149
42150
42151
42152
42153
42154
42155
42156
.....
42163
42164
42165
42166
42167
42168
42169
42170
42171
42172
42173
42174
42175
42176
42177
.....
42572
42573
42574
42575
42576
42577
42578
42579
42580
42581
42582
42583
42584
42585
42586
.....
42652
42653
42654
42655
42656
42657
42658
42659
42660
42661
42662
42663
42664
42665
42666
.....
42795
42796
42797
42798
42799
42800
42801
42802
42803
42804
42805
42806
42807
42808
42809
.....
43924
43925
43926
43927
43928
43929
43930
43931
43932
43933
43934
43935
43936
43937
43938
.....
44198
44199
44200
44201
44202
44203
44204
44205
44206
44207
44208
44209
44210
44211
44212
.....
44408
44409
44410
44411
44412
44413
44414
44415
44416
44417
44418
44419
44420
44421
44422
.....
44745
44746
44747
44748
44749
44750
44751
44752
44753
44754
44755
44756
44757
44758
44759
.....
45725
45726
45727
45728
45729
45730
45731
45732
45733
45734
45735
45736
45737
45738
45739
.....
46549
46550
46551
46552
46553
46554
46555
46556
46557
46558
46559
46560
46561
46562
46563
.....
47173
47174
47175
47176
47177
47178
47179
47180
47181
47182
47183
47184
47185
47186
47187
.....
48458
48459
48460
48461
48462
48463
48464
48465
48466
48467
48468
48469
48470
48471
48472
.....
50147
50148
50149
50150
50151
50152
50153
50154
50155
50156
50157
50158
50159
50160
50161
50162
50163
50164
50165
50166
50167
50168
50169
50170
50171
50172
50173
50174
.....
50385
50386
50387
50388
50389
50390
50391
50392
50393
50394
50395
50396
50397
50398
50399
.....
51399
51400
51401
51402
51403
51404
51405
51406
51407
51408
51409
51410
51411
51412
51413
.....
51483
51484
51485
51486
51487
51488
51489
51490
51491
51492
51493
51494
51495
51496
51497
.....
51799
51800
51801
51802
51803
51804
51805
51806
51807
51808
51809
51810
51811
51812
51813
.....
52798
52799
52800
52801
52802
52803
52804
52805
52806
52807
52808
52809
52810
52811
52812
.....
53400
53401
53402
53403
53404
53405
53406
53407
53408
53409
53410
53411
53412
53413
53414
.....
53590
53591
53592
53593
53594
53595
53596
53597
53598
53599
53600
53601
53602
53603
53604
.....
53838
53839
53840
53841
53842
53843
53844
53845
53846
53847
53848
53849
53850
53851
53852
.....
54180
54181
54182
54183
54184
54185
54186
54187
54188
54189
54190
54191
54192
54193
54194
.....
54922
54923
54924
54925
54926
54927
54928
54929
54930
54931
54932
54933
54934
54935
54936
.....
55094
55095
55096
55097
55098
55099
55100
55101
55102
55103
55104
55105
55106
55107
55108
.....
55244
55245
55246
55247
55248
55249
55250
55251
55252
55253
55254
55255
55256
55257
55258
.....
55769
55770
55771
55772
55773
55774
55775
55776
55777
55778
55779
55780
55781
55782
55783
.....
56491
56492
56493
56494
56495
56496
56497
56498
56499
56500
56501
56502
56503
56504
56505
.....
56631
56632
56633
56634
56635
56636
56637
56638
56639
56640
56641
56642
56643
56644
56645
.....
57475
57476
57477
57478
57479
57480
57481
57482
57483
57484
57485
57486
57487
57488
57489
.....
58517
58518
58519
58520
58521
58522
58523
58524
58525
58526
58527
58528
58529
58530
58531
.....
58934
58935
58936
58937
58938
58939
58940
58941
58942
58943
58944
58945
58946
58947
58948
.....
59036
59037
59038
59039
59040
59041
59042
59043
59044
59045
59046
59047
59048
59049
59050
.....
59589
59590
59591
59592
59593
59594
59595
59596
59597
59598
59599
59600
59601
59602
59603
.....
59695
59696
59697
59698
59699
59700
59701
59702
59703
59704
59705
59706
59707
59708
59709
.....
61517
61518
61519
61520
61521
61522
61523
61524
61525
61526
61527
61528
61529
61530
61531
.....
61762
61763
61764
61765
61766
61767
61768
61769
61770
61771
61772
61773
61774
61775
61776
.....
62589
62590
62591
62592
62593
62594
62595
62596
62597
62598
62599
62600
62601
62602
62603
.....
62972
62973
62974
62975
62976
62977
62978
62979
62980
62981
62982
62983
62984
62985
62986
.....
63350
63351
63352
63353
63354
63355
63356
63357
63358
63359
63360
63361
63362
63363
63364
.....
64058
64059
64060
64061
64062
64063
64064
64065
64066
64067
64068
64069
64070
64071
64072
.....
64102
64103
64104
64105
64106
64107
64108
64109
64110
64111
64112
64113
64114
64115
64116
.....
64433
64434
64435
64436
64437
64438
64439
64440
64441
64442
64443
64444
64445
64446
64447
.....
64576
64577
64578
64579
64580
64581
64582
64583
64584
64585
64586
64587
64588
64589
64590
SELECT ALL - AVG ( DISTINCT col0 ) FROM tab2 GROUP BY col2, col0 HAVING NULL IS NOT NULL
----

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col0 col0 FROM tab0 GROUP BY col0, col1
................................................................................
query I rowsort
SELECT ALL col1 + + col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL IS NULL
----
114
12
88

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col0 col0, col0 FROM tab2 GROUP BY col1, col0
----
15
15
91
91
................................................................................
query I rowsort
SELECT DISTINCT + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0
----
26
43
83

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 col2, col2 AS col1 FROM tab0 GROUP BY col2
----
24
24
38
38
................................................................................
query I rowsort
SELECT ALL + - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

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

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

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

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

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

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

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

query I rowsort
SELECT DISTINCT - col1 AS col1 FROM tab1 WHERE NULL < - col1 * - col1 GROUP BY col1
----
................................................................................
query I rowsort
SELECT - col0 + - - col0 AS col1 FROM tab0 GROUP BY col0, col0
----
0
0
0

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

query I rowsort
SELECT - col0 FROM tab2 AS cor0 GROUP BY col0, col2, col0
----
................................................................................
query I rowsort
SELECT + col2 - - col2 + - col1 FROM tab1 GROUP BY col2, col1
----
10
33
98

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 col2, col0 + - col0 AS col1 FROM tab1 GROUP BY col0
----
22
0
28
0
................................................................................
query I rowsort
SELECT - col1 * + - col1 + + col1 FROM tab2 GROUP BY col1
----
1722
3540
3782

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col2 col1, - col2 FROM tab0 AS cor0 GROUP BY col2
----
24
-24
38
-38
................................................................................
query I rowsort label-1307
SELECT - - col1 / + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
1
1
1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1 col0, col2 FROM tab1 GROUP BY col1, col2
----
44
71
57
45
................................................................................
79
87

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

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

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

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

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

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

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

query I rowsort
SELECT + col0 AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT AVG ( DISTINCT - col2 ) IS NULL
----
................................................................................
query I rowsort
SELECT + col0 * col0 FROM tab1 GROUP BY col0
----
484
6724
784

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

query II rowsort
SELECT col0 AS col1, col0 FROM tab2 AS cor0 GROUP BY col2, col0, col1
----
................................................................................
-38
-79

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col1, col0 FROM tab2 GROUP BY col0, col2, col1
----
41
92
59
91
................................................................................
query I rowsort
SELECT ALL col0 * + col0 FROM tab1 GROUP BY col0
----
484
6724
784

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

query I rowsort
SELECT col2 FROM tab0 cor0 WHERE NOT NULL IS NULL GROUP BY col2
----
................................................................................
query I rowsort
SELECT col0 FROM tab1 GROUP BY col1, col1, col0
----
22
28
82

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

query II rowsort
SELECT col0, - col0 FROM tab2 GROUP BY col0
----
................................................................................
query I rowsort
SELECT DISTINCT col0 * col0 col0 FROM tab0 GROUP BY col0
----
1849
676
6889

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

query I rowsort
SELECT ALL + col0 - - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
................................................................................
SELECT col0 FROM tab0 GROUP BY col0 HAVING - col0 <> NULL
----

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

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

query I rowsort
SELECT col0 * + col0 FROM tab2 GROUP BY col0, col2, col0
----
................................................................................
query I rowsort
SELECT ALL + col1 * col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
2378
4661
5307

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT + col1 AS col1, col1 AS col2 FROM tab1 GROUP BY col1 HAVING ( NULL ) = col2
----

query I rowsort
SELECT DISTINCT - + col2 * - col2 + + col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
................................................................................
-43
-83

query I rowsort
SELECT - col1 * - + col1 FROM tab0 GROUP BY col1, col0 HAVING ( - col1 ) > NULL
----

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1 col1, + col2 FROM tab1 AS cor0 WHERE NULL IS NULL GROUP BY col1, col2
----
44
71
57
45
................................................................................
query I rowsort
SELECT DISTINCT - col2 * col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
-3364
-6241
-7569

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + col0 AS col2 FROM tab0 WHERE NULL IS NOT NULL GROUP BY col0 HAVING NULL > + col2
----

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

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

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

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

query I rowsort
SELECT - col0 * + + col0 AS col2 FROM tab0 cor0 GROUP BY col0
----
................................................................................
query I rowsort
SELECT - col2 + - col2 FROM tab2 GROUP BY col2, col0 HAVING NOT - col0 IS NULL
----
-116
-158
-174

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + + col0 + - - col0 col2, - col0 FROM tab0 AS cor0 GROUP BY col0
----
166
-83
52
-26
................................................................................
query I rowsort
SELECT + - col2 col0 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) IS NULL
----
-24
-38
-79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col2, + col0 AS col0 FROM tab2 GROUP BY col0, col0
----
15
15
91
91
................................................................................
SELECT ALL - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0, col2, col2 HAVING NULL = - col0
----

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

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

query I rowsort
SELECT col2 FROM tab2 GROUP BY col2 HAVING + col2 IS NULL
----
................................................................................
3249
36

query I rowsort
SELECT ALL + col2 FROM tab0 GROUP BY col2 HAVING NOT NULL BETWEEN NULL AND ( col2 )
----

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT - col1 col0 FROM tab0 AS cor0 GROUP BY col1
................................................................................
query I rowsort
SELECT + col2 * col0 AS col1 FROM tab2 GROUP BY col2, col0
----
1305
5336
7189

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col1, + col2 FROM tab1 GROUP BY col0, col2
----
22
8
28
45
................................................................................
query I rowsort
SELECT ALL - col2 AS col0 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col0, col2
----
-24
-38
-79

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

query I rowsort
SELECT DISTINCT col0 FROM tab1 cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN NULL AND - AVG ( DISTINCT - col1 )
----
................................................................................
query I rowsort
SELECT ALL - col1 * - col1 AS col2 FROM tab1 GROUP BY col1
----
1936
3249
36

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

query I rowsort
SELECT DISTINCT col0 FROM tab2 GROUP BY col0, col2 HAVING NULL IS NOT NULL
----
................................................................................
query I rowsort
SELECT - + col0 - + col0 FROM tab0 AS cor0 GROUP BY col0
----
-166
-52
-86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col1, col2 FROM tab0 AS cor0 WHERE NOT - col0 IS NULL GROUP BY col2
----
24
24
38
38
................................................................................
query I rowsort
SELECT col0 + - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
0
0
0

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

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

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

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

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

query I rowsort
SELECT + col0 AS col0 FROM tab2 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0
----
................................................................................
59
61

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col0 col0, col0 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1
----
15
15
91
91
................................................................................
query I rowsort
SELECT ALL col2 col0 FROM tab2 cor0 GROUP BY col2 HAVING NULL IS NULL
----
58
79
87

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

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

query I rowsort
SELECT ALL - col1 * - + col1 AS col1 FROM tab1 GROUP BY col1, col1
----
................................................................................
-43
-83

query I rowsort
SELECT ALL + col0 FROM tab0 cor0 WHERE NOT NULL >= NULL GROUP BY col1, col0, col1
----

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

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

query I rowsort
SELECT DISTINCT + col2 * + col2 * + col2 FROM tab0 GROUP BY col2
----
................................................................................
SELECT ALL - col1 + - col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col1
----

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

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

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

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

query I rowsort
SELECT ALL col2 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL NOT IN ( - AVG ( - col2 ) )
----
................................................................................
-71
-8

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

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

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

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

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + + col0 * + - col0 col1, - col0 FROM tab1 AS cor0 GROUP BY col0
----
-484
-22
-6724
-82
................................................................................
SELECT - + col0 FROM tab0 WHERE NOT NULL > NULL GROUP BY col0, col2 HAVING NULL IS NOT NULL
----

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + AVG ( - + col0 ) * col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL = - - col1 + - AVG ( ALL col0 )
----

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 col2, col2 AS col0 FROM tab0 AS cor0 WHERE NOT NULL IS NOT NULL GROUP BY col2
----
24
24
38
38
................................................................................

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

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

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

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

query I rowsort
SELECT ALL col1 - + col2 FROM tab0 GROUP BY col2, col1
----
................................................................................
query I rowsort
SELECT DISTINCT + col1 FROM tab2 GROUP BY col1 HAVING NULL IS NULL
----
41
59
61

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

query I rowsort
SELECT ALL + col2 * + col0 AS col0 FROM tab1 GROUP BY col0, col2
----
................................................................................
6972
702

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

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

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

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

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT AVG ( ALL + col0 ) * - AVG ( DISTINCT col0 ) AS col1 FROM tab1 GROUP BY col0 HAVING ( col1 ) <> NULL
----

query I rowsort
SELECT ALL - col0 FROM tab1 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----
................................................................................
43
83

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

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 col1, col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
15
15
91
91
................................................................................
SELECT + col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col2 col1, - col1 AS col0 FROM tab1 GROUP BY col2, col1
----
45
-57
71
-44
................................................................................
query I rowsort
SELECT DISTINCT col0 * col0 FROM tab2 GROUP BY col0
----
225
8281
8464

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

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

query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab0 AS cor0 WHERE NOT NULL NOT BETWEEN + col0 AND col1 GROUP BY col2
----
................................................................................
query I rowsort
SELECT - + col1 AS col0 FROM tab2 WHERE NOT - col1 IS NULL GROUP BY col1, col1
----
-41
-59
-61

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1 col2, - col1 AS col0 FROM tab2 GROUP BY col1
----
41
-41
59
-59
................................................................................
query I rowsort
SELECT DISTINCT + col0 col0 FROM tab1 AS cor0 WHERE - col2 IS NOT NULL GROUP BY col0
----
22
28
82

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col0 col0 FROM tab2 cor0 GROUP BY col0 HAVING NULL IS NULL
................................................................................
24
43
38
83
79
26

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col0 col2, col1 * - col1 AS col0 FROM tab2 GROUP BY col0, col1
----
15
-3721
91
-3481
................................................................................
0
81

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

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

query I rowsort
SELECT DISTINCT - + col2 FROM tab2 AS cor0 GROUP BY col2, col1
----
................................................................................
query I rowsort
SELECT ALL + col2 - - + col2 + - - col2 FROM tab2 AS cor0 GROUP BY col2
----
174
237
261

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

query I rowsort
SELECT ALL + col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL > NULL
----
................................................................................
92

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort
SELECT - col2 col2, col2, col2 AS col1 FROM tab2 GROUP BY col2
----
9 values hashing to 0b557cf9945bfac98ef8ff910306a370

query I rowsort
SELECT + col0 * + - col0 + + col0 FROM tab1 GROUP BY col0
................................................................................
SELECT ALL - + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING ( col2 ) IS NULL
----

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

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

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

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

query I rowsort
SELECT col2 + - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2
----
................................................................................
43
83

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col1 col1, col1 + col1 * + col1 AS col0 FROM tab1 GROUP BY col2, col1
----
-44
1980
-57
3306
................................................................................
SELECT ALL col2 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING + col2 < NULL
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col2, col0 FROM tab2 GROUP BY col0, col1
----
15
15
91
91
................................................................................
query I rowsort
SELECT ALL + - col1 - - + col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING ( NULL IS NULL )
----
0
0
0

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 col2 * col0 <> ( NULL )
----

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col2 col2, col2 AS col0 FROM tab2 GROUP BY col2
----
-58
58
-79
79
................................................................................
-3306
-42

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col1 col2, col1 AS col1 FROM tab2 WHERE NOT ( + col1 ) IS NOT NULL GROUP BY col1, col1
----

query I rowsort
SELECT DISTINCT col0 AS col1 FROM tab0 cor0 GROUP BY col0, col0 HAVING + col0 IS NOT NULL
----
................................................................................
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 - col2 col1, col2 AS col1 FROM tab2 GROUP BY col2
----
-58
58
-79
79
................................................................................
query I rowsort
SELECT - col0 AS col2 FROM tab1 cor0 GROUP BY col0, col2
----
-22
-28
-82

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

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

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 + + - col1
----

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

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

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col1 col1, - col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col1, col0
----
41
-92
59
-91
................................................................................
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 II rowsort
SELECT - - col0 col2, col0 FROM tab2 AS cor0 GROUP BY col0
----
15
15
91
91
................................................................................
71
8

query I rowsort
SELECT DISTINCT col0 FROM tab1 cor0 WHERE NOT ( col0 ) <= NULL GROUP BY col2, col0, col1
----

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

query II rowsort
SELECT DISTINCT - col0 * + col0, + col0 FROM tab2 AS cor0 GROUP BY col0
----

Changes to test/random/groupby/slt_good_11.test.

631
632
633
634
635
636
637

638
639
640
641
642
643
644
....
1273
1274
1275
1276
1277
1278
1279

1280
1281
1282
1283
1284
1285
1286
....
1986
1987
1988
1989
1990
1991
1992

1993
1994
1995
1996
1997
1998
1999
....
2610
2611
2612
2613
2614
2615
2616

2617
2618
2619
2620
2621
2622
2623
....
2654
2655
2656
2657
2658
2659
2660

2661
2662
2663
2664
2665
2666
2667
....
3284
3285
3286
3287
3288
3289
3290

3291
3292
3293
3294
3295
3296
3297
....
3791
3792
3793
3794
3795
3796
3797

3798
3799
3800
3801
3802
3803
3804
....
3982
3983
3984
3985
3986
3987
3988

3989
3990
3991
3992
3993
3994
3995
....
4116
4117
4118
4119
4120
4121
4122

4123
4124
4125
4126
4127
4128
4129
....
4660
4661
4662
4663
4664
4665
4666

4667
4668
4669
4670
4671
4672
4673
....
6749
6750
6751
6752
6753
6754
6755

6756
6757
6758
6759
6760
6761
6762
....
6961
6962
6963
6964
6965
6966
6967

6968
6969
6970
6971
6972
6973
6974
....
7021
7022
7023
7024
7025
7026
7027

7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038

7039
7040
7041
7042
7043
7044
7045
....
7220
7221
7222
7223
7224
7225
7226

7227
7228
7229
7230
7231
7232
7233
....
8056
8057
8058
8059
8060
8061
8062

8063
8064
8065
8066
8067
8068
8069
....
8074
8075
8076
8077
8078
8079
8080

8081
8082
8083
8084
8085
8086
8087
....
9564
9565
9566
9567
9568
9569
9570

9571
9572
9573
9574
9575
9576
9577
....
9867
9868
9869
9870
9871
9872
9873

9874
9875
9876
9877
9878
9879
9880
.....
10205
10206
10207
10208
10209
10210
10211

10212
10213
10214
10215
10216
10217
10218
.....
10373
10374
10375
10376
10377
10378
10379

10380
10381
10382
10383
10384
10385
10386
.....
10692
10693
10694
10695
10696
10697
10698

10699
10700
10701
10702
10703
10704
10705
.....
11155
11156
11157
11158
11159
11160
11161

11162
11163
11164
11165
11166
11167
11168
.....
11913
11914
11915
11916
11917
11918
11919

11920
11921
11922
11923
11924
11925
11926
.....
12935
12936
12937
12938
12939
12940
12941

12942
12943
12944
12945
12946
12947
12948
.....
13107
13108
13109
13110
13111
13112
13113

13114
13115
13116
13117
13118
13119
13120
.....
13156
13157
13158
13159
13160
13161
13162

13163
13164
13165
13166
13167
13168
13169
.....
13249
13250
13251
13252
13253
13254
13255

13256
13257
13258
13259
13260
13261
13262
.....
13461
13462
13463
13464
13465
13466
13467

13468
13469
13470
13471
13472
13473
13474
.....
13619
13620
13621
13622
13623
13624
13625

13626
13627
13628
13629
13630
13631
13632
.....
13802
13803
13804
13805
13806
13807
13808

13809
13810
13811
13812
13813
13814
13815
.....
14596
14597
14598
14599
14600
14601
14602

14603
14604
14605
14606
14607
14608
14609
.....
14631
14632
14633
14634
14635
14636
14637

14638
14639
14640
14641
14642
14643
14644
.....
14971
14972
14973
14974
14975
14976
14977

14978
14979
14980
14981
14982
14983
14984
.....
15149
15150
15151
15152
15153
15154
15155

15156
15157
15158
15159
15160
15161
15162
.....
15176
15177
15178
15179
15180
15181
15182

15183
15184
15185
15186
15187
15188
15189
.....
15429
15430
15431
15432
15433
15434
15435

15436
15437
15438
15439
15440
15441
15442
.....
15653
15654
15655
15656
15657
15658
15659

15660
15661
15662
15663
15664
15665
15666
.....
16034
16035
16036
16037
16038
16039
16040

16041
16042
16043
16044
16045
16046
16047
.....
16170
16171
16172
16173
16174
16175
16176

16177
16178
16179
16180
16181
16182
16183
.....
16817
16818
16819
16820
16821
16822
16823

16824
16825
16826
16827
16828
16829
16830
.....
17510
17511
17512
17513
17514
17515
17516

17517
17518
17519
17520
17521
17522
17523
.....
17633
17634
17635
17636
17637
17638
17639

17640
17641
17642
17643
17644
17645
17646
.....
17911
17912
17913
17914
17915
17916
17917

17918
17919
17920
17921
17922
17923
17924
.....
18524
18525
18526
18527
18528
18529
18530

18531
18532
18533
18534
18535
18536
18537
.....
18544
18545
18546
18547
18548
18549
18550

18551
18552
18553
18554
18555
18556
18557
.....
18644
18645
18646
18647
18648
18649
18650

18651
18652
18653
18654
18655
18656
18657
.....
18963
18964
18965
18966
18967
18968
18969

18970
18971
18972
18973
18974
18975
18976
.....
19096
19097
19098
19099
19100
19101
19102

19103
19104
19105
19106
19107
19108
19109
.....
19864
19865
19866
19867
19868
19869
19870

19871
19872
19873
19874
19875
19876
19877
.....
19970
19971
19972
19973
19974
19975
19976

19977
19978
19979
19980
19981
19982
19983
.....
20085
20086
20087
20088
20089
20090
20091

20092
20093
20094
20095
20096
20097
20098
.....
20985
20986
20987
20988
20989
20990
20991

20992
20993
20994
20995
20996
20997
20998
.....
21000
21001
21002
21003
21004
21005
21006

21007
21008
21009
21010
21011
21012
21013
.....
21045
21046
21047
21048
21049
21050
21051

21052
21053
21054
21055
21056
21057
21058
.....
21663
21664
21665
21666
21667
21668
21669

21670
21671
21672
21673
21674
21675
21676
.....
22015
22016
22017
22018
22019
22020
22021

22022
22023
22024
22025
22026
22027
22028
.....
22249
22250
22251
22252
22253
22254
22255

22256
22257
22258
22259
22260
22261
22262
.....
22480
22481
22482
22483
22484
22485
22486

22487
22488
22489
22490
22491
22492
22493
.....
22724
22725
22726
22727
22728
22729
22730

22731
22732
22733
22734
22735
22736
22737
.....
23173
23174
23175
23176
23177
23178
23179

23180
23181
23182
23183
23184
23185
23186
.....
23464
23465
23466
23467
23468
23469
23470

23471
23472
23473
23474
23475
23476
23477
.....
23797
23798
23799
23800
23801
23802
23803

23804
23805
23806
23807
23808
23809
23810
.....
23934
23935
23936
23937
23938
23939
23940

23941
23942
23943
23944
23945
23946
23947
.....
24373
24374
24375
24376
24377
24378
24379

24380
24381
24382
24383
24384
24385
24386
.....
24730
24731
24732
24733
24734
24735
24736

24737
24738
24739
24740
24741
24742
24743
.....
24770
24771
24772
24773
24774
24775
24776

24777
24778
24779
24780
24781
24782
24783
.....
24846
24847
24848
24849
24850
24851
24852

24853
24854
24855
24856
24857
24858
24859
.....
25557
25558
25559
25560
25561
25562
25563

25564
25565
25566
25567
25568
25569
25570
.....
25977
25978
25979
25980
25981
25982
25983

25984
25985
25986
25987
25988
25989
25990
.....
26230
26231
26232
26233
26234
26235
26236

26237
26238
26239
26240
26241
26242
26243
.....
26489
26490
26491
26492
26493
26494
26495

26496
26497
26498
26499
26500
26501
26502
.....
26748
26749
26750
26751
26752
26753
26754

26755
26756
26757
26758
26759
26760
26761
.....
27330
27331
27332
27333
27334
27335
27336

27337
27338
27339
27340
27341
27342
27343
.....
28481
28482
28483
28484
28485
28486
28487

28488
28489
28490
28491
28492
28493
28494
.....
28601
28602
28603
28604
28605
28606
28607

28608
28609
28610
28611
28612
28613
28614
.....
28683
28684
28685
28686
28687
28688
28689

28690
28691
28692
28693
28694
28695
28696
.....
28826
28827
28828
28829
28830
28831
28832

28833
28834
28835
28836
28837
28838
28839
.....
30061
30062
30063
30064
30065
30066
30067

30068
30069
30070
30071
30072
30073
30074
.....
30499
30500
30501
30502
30503
30504
30505

30506
30507
30508
30509
30510
30511
30512
.....
30694
30695
30696
30697
30698
30699
30700

30701
30702
30703
30704
30705
30706
30707
.....
31031
31032
31033
31034
31035
31036
31037

31038
31039
31040
31041
31042
31043
31044
.....
31108
31109
31110
31111
31112
31113
31114

31115
31116
31117
31118
31119
31120
31121
.....
31201
31202
31203
31204
31205
31206
31207

31208
31209
31210
31211
31212
31213
31214
.....
31248
31249
31250
31251
31252
31253
31254

31255
31256
31257
31258
31259
31260
31261
.....
31328
31329
31330
31331
31332
31333
31334

31335
31336
31337
31338
31339
31340
31341
.....
31823
31824
31825
31826
31827
31828
31829

31830
31831
31832
31833
31834
31835
31836
.....
31935
31936
31937
31938
31939
31940
31941

31942
31943
31944
31945
31946
31947
31948
.....
32011
32012
32013
32014
32015
32016
32017

32018
32019
32020
32021
32022
32023
32024
.....
32057
32058
32059
32060
32061
32062
32063

32064
32065
32066
32067
32068
32069
32070
.....
32163
32164
32165
32166
32167
32168
32169

32170
32171
32172
32173
32174
32175
32176
.....
32990
32991
32992
32993
32994
32995
32996

32997
32998
32999
33000
33001
33002
33003
.....
33364
33365
33366
33367
33368
33369
33370

33371
33372
33373
33374
33375
33376
33377
.....
33512
33513
33514
33515
33516
33517
33518

33519
33520
33521
33522
33523
33524
33525
.....
33574
33575
33576
33577
33578
33579
33580

33581
33582
33583
33584
33585
33586
33587
.....
33712
33713
33714
33715
33716
33717
33718

33719
33720
33721
33722
33723
33724
33725
.....
33748
33749
33750
33751
33752
33753
33754

33755
33756
33757
33758
33759
33760
33761
.....
34088
34089
34090
34091
34092
34093
34094

34095
34096
34097
34098
34099
34100
34101
.....
34157
34158
34159
34160
34161
34162
34163

34164
34165
34166
34167
34168
34169
34170
.....
34463
34464
34465
34466
34467
34468
34469

34470
34471
34472
34473
34474
34475
34476
.....
34749
34750
34751
34752
34753
34754
34755

34756
34757
34758
34759
34760
34761
34762
34763
34764
34765

34766
34767
34768
34769
34770
34771
34772
.....
34938
34939
34940
34941
34942
34943
34944

34945
34946
34947
34948
34949
34950
34951
.....
35741
35742
35743
35744
35745
35746
35747

35748
35749
35750
35751
35752
35753
35754
.....
35817
35818
35819
35820
35821
35822
35823

35824
35825
35826
35827
35828
35829
35830
.....
36403
36404
36405
36406
36407
36408
36409

36410
36411
36412
36413
36414
36415
36416
.....
36495
36496
36497
36498
36499
36500
36501

36502
36503
36504
36505
36506
36507
36508
.....
36599
36600
36601
36602
36603
36604
36605

36606
36607
36608
36609
36610
36611
36612
.....
37562
37563
37564
37565
37566
37567
37568

37569
37570
37571
37572
37573
37574
37575
.....
37927
37928
37929
37930
37931
37932
37933

37934
37935
37936
37937
37938
37939
37940
.....
38334
38335
38336
38337
38338
38339
38340

38341
38342
38343
38344
38345
38346
38347
.....
38361
38362
38363
38364
38365
38366
38367

38368
38369
38370
38371
38372
38373
38374
.....
38854
38855
38856
38857
38858
38859
38860

38861
38862
38863
38864
38865
38866
38867
.....
39082
39083
39084
39085
39086
39087
39088

39089
39090
39091
39092
39093
39094
39095
.....
39377
39378
39379
39380
39381
39382
39383

39384
39385
39386
39387
39388
39389
39390
.....
39411
39412
39413
39414
39415
39416
39417

39418
39419
39420
39421
39422
39423
39424
.....
39475
39476
39477
39478
39479
39480
39481

39482
39483
39484
39485
39486
39487
39488
.....
39687
39688
39689
39690
39691
39692
39693

39694
39695
39696
39697
39698
39699
39700
.....
39952
39953
39954
39955
39956
39957
39958

39959
39960
39961
39962
39963
39964
39965
.....
40152
40153
40154
40155
40156
40157
40158

40159
40160
40161
40162
40163
40164
40165
.....
40681
40682
40683
40684
40685
40686
40687

40688
40689
40690
40691
40692
40693
40694
.....
40894
40895
40896
40897
40898
40899
40900

40901
40902
40903
40904
40905
40906
40907
.....
41931
41932
41933
41934
41935
41936
41937

41938
41939
41940
41941
41942
41943
41944
.....
42143
42144
42145
42146
42147
42148
42149

42150
42151
42152
42153
42154
42155
42156
.....
42157
42158
42159
42160
42161
42162
42163

42164
42165
42166
42167
42168
42169
42170
.....
42330
42331
42332
42333
42334
42335
42336

42337
42338
42339
42340
42341
42342
42343
.....
42354
42355
42356
42357
42358
42359
42360

42361
42362
42363
42364
42365
42366
42367
.....
42536
42537
42538
42539
42540
42541
42542

42543
42544
42545
42546
42547
42548
42549
.....
42777
42778
42779
42780
42781
42782
42783

42784
42785
42786
42787
42788
42789
42790
.....
42921
42922
42923
42924
42925
42926
42927

42928
42929
42930
42931
42932
42933
42934
.....
42988
42989
42990
42991
42992
42993
42994

42995
42996
42997
42998
42999
43000
43001
.....
43171
43172
43173
43174
43175
43176
43177

43178
43179
43180
43181
43182
43183
43184
.....
43280
43281
43282
43283
43284
43285
43286

43287
43288
43289
43290
43291
43292
43293
.....
43491
43492
43493
43494
43495
43496
43497

43498
43499
43500
43501
43502
43503
43504
.....
43963
43964
43965
43966
43967
43968
43969

43970
43971
43972
43973
43974
43975
43976
.....
44418
44419
44420
44421
44422
44423
44424

44425
44426
44427
44428
44429
44430
44431
.....
44468
44469
44470
44471
44472
44473
44474

44475
44476
44477
44478
44479
44480
44481
.....
44997
44998
44999
45000
45001
45002
45003

45004
45005
45006
45007
45008
45009
45010
.....
45042
45043
45044
45045
45046
45047
45048

45049
45050
45051
45052
45053
45054
45055
.....
45433
45434
45435
45436
45437
45438
45439

45440
45441
45442
45443
45444
45445
45446
.....
45467
45468
45469
45470
45471
45472
45473

45474
45475
45476
45477
45478
45479
45480
.....
46210
46211
46212
46213
46214
46215
46216

46217
46218
46219
46220
46221
46222
46223
.....
46433
46434
46435
46436
46437
46438
46439

46440
46441
46442
46443
46444
46445
46446
.....
46679
46680
46681
46682
46683
46684
46685

46686
46687
46688
46689
46690
46691
46692
.....
46790
46791
46792
46793
46794
46795
46796

46797
46798
46799
46800
46801
46802
46803
.....
46874
46875
46876
46877
46878
46879
46880

46881
46882
46883
46884
46885
46886
46887
.....
47832
47833
47834
47835
47836
47837
47838

47839
47840
47841
47842
47843
47844
47845
.....
47991
47992
47993
47994
47995
47996
47997

47998
47999
48000
48001
48002
48003
48004
.....
48053
48054
48055
48056
48057
48058
48059

48060
48061
48062
48063
48064
48065
48066
.....
48086
48087
48088
48089
48090
48091
48092

48093
48094
48095
48096
48097
48098
48099
.....
48699
48700
48701
48702
48703
48704
48705

48706
48707
48708
48709
48710
48711
48712
.....
48858
48859
48860
48861
48862
48863
48864

48865
48866
48867
48868
48869
48870
48871
.....
49179
49180
49181
49182
49183
49184
49185

49186
49187
49188
49189
49190
49191
49192
.....
49374
49375
49376
49377
49378
49379
49380

49381
49382
49383
49384
49385
49386
49387
.....
49540
49541
49542
49543
49544
49545
49546

49547
49548
49549
49550
49551
49552
49553
.....
50844
50845
50846
50847
50848
50849
50850

50851
50852
50853
50854
50855
50856
50857
.....
51133
51134
51135
51136
51137
51138
51139

51140
51141
51142
51143
51144
51145
51146
.....
51308
51309
51310
51311
51312
51313
51314

51315
51316
51317
51318
51319
51320
51321
.....
51617
51618
51619
51620
51621
51622
51623

51624
51625
51626
51627
51628
51629
51630
.....
51684
51685
51686
51687
51688
51689
51690

51691
51692
51693
51694
51695
51696
51697
.....
51756
51757
51758
51759
51760
51761
51762

51763
51764
51765
51766
51767
51768
51769
51770
51771
51772
51773
51774
51775

51776
51777
51778
51779
51780
51781
51782
.....
51934
51935
51936
51937
51938
51939
51940

51941
51942
51943
51944
51945
51946
51947
.....
52127
52128
52129
52130
52131
52132
52133

52134
52135
52136
52137
52138
52139
52140
.....
52475
52476
52477
52478
52479
52480
52481

52482
52483
52484
52485
52486
52487
52488
52489
52490
52491

52492
52493
52494
52495
52496
52497
52498
.....
52673
52674
52675
52676
52677
52678
52679

52680
52681
52682
52683
52684
52685
52686
.....
52843
52844
52845
52846
52847
52848
52849

52850
52851
52852
52853
52854
52855
52856
.....
53055
53056
53057
53058
53059
53060
53061

53062
53063
53064
53065
53066
53067
53068
.....
53199
53200
53201
53202
53203
53204
53205

53206
53207
53208
53209
53210
53211
53212
.....
53504
53505
53506
53507
53508
53509
53510

53511
53512
53513
53514
53515
53516
53517
.....
53858
53859
53860
53861
53862
53863
53864

53865
53866
53867
53868
53869
53870
53871
.....
53890
53891
53892
53893
53894
53895
53896

53897
53898
53899
53900
53901
53902
53903
.....
54064
54065
54066
54067
54068
54069
54070

54071
54072
54073
54074

54075
54076
54077
54078
54079
54080
54081
.....
54300
54301
54302
54303
54304
54305
54306

54307
54308
54309
54310
54311
54312
54313
.....
55610
55611
55612
55613
55614
55615
55616

55617
55618
55619
55620
55621
55622
55623
.....
56314
56315
56316
56317
56318
56319
56320

56321
56322
56323
56324
56325
56326
56327
.....
56385
56386
56387
56388
56389
56390
56391

56392
56393
56394
56395
56396
56397
56398
.....
56424
56425
56426
56427
56428
56429
56430

56431
56432
56433
56434
56435
56436
56437
.....
56727
56728
56729
56730
56731
56732
56733

56734
56735
56736
56737
56738
56739
56740
.....
58112
58113
58114
58115
58116
58117
58118

58119
58120
58121
58122
58123
58124
58125
.....
58483
58484
58485
58486
58487
58488
58489

58490
58491
58492
58493
58494
58495
58496
.....
58837
58838
58839
58840
58841
58842
58843

58844
58845
58846
58847
58848
58849
58850
.....
59287
59288
59289
59290
59291
59292
59293

59294
59295
59296
59297
59298
59299
59300
.....
59421
59422
59423
59424
59425
59426
59427

59428
59429
59430
59431
59432
59433
59434
.....
59463
59464
59465
59466
59467
59468
59469

59470
59471
59472
59473
59474
59475
59476
.....
59564
59565
59566
59567
59568
59569
59570

59571
59572
59573
59574
59575
59576
59577
.....
59866
59867
59868
59869
59870
59871
59872

59873
59874
59875
59876
59877
59878
59879
.....
61663
61664
61665
61666
61667
61668
61669

61670
61671
61672
61673
61674
61675
61676
.....
61709
61710
61711
61712
61713
61714
61715

61716
61717
61718
61719

61720
61721
61722
61723
61724
61725
61726
.....
61733
61734
61735
61736
61737
61738
61739

61740
61741
61742
61743
61744
61745
61746
.....
62280
62281
62282
62283
62284
62285
62286

62287
62288
62289
62290
62291
62292
62293
62294
62295
62296
62297

62298
62299
62300
62301
62302
62303
62304
.....
62823
62824
62825
62826
62827
62828
62829

62830
62831
62832
62833
62834
62835
62836
.....
62919
62920
62921
62922
62923
62924
62925

62926
62927
62928
62929
62930
62931
62932
.....
63071
63072
63073
63074
63075
63076
63077

63078
63079
63080
63081
63082
63083
63084
.....
63857
63858
63859
63860
63861
63862
63863

63864
63865
63866
63867
63868
63869
63870
.....
64412
64413
64414
64415
64416
64417
64418

64419
64420
64421
64422
64423
64424
64425
.....
64480
64481
64482
64483
64484
64485
64486

64487
64488
64489
64490
64491
64492
64493
.....
65127
65128
65129
65130
65131
65132
65133

65134
65135
65136
65137
65138
65139
65140
.....
65160
65161
65162
65163
65164
65165
65166

65167
65168
65169
65170
65171
65172
65173
.....
65428
65429
65430
65431
65432
65433
65434

65435
65436
65437
65438
65439
65440
65441
.....
65573
65574
65575
65576
65577
65578
65579

65580
65581
65582
65583
65584
65585
65586
.....
65775
65776
65777
65778
65779
65780
65781

65782
65783
65784
65785
65786
65787
65788
.....
65848
65849
65850
65851
65852
65853
65854

65855
65856
65857
65858
65859
65860
65861
.....
65895
65896
65897
65898
65899
65900
65901

65902
65903
65904
65905
65906
65907
65908
.....
65986
65987
65988
65989
65990
65991
65992

65993
65994
65995
65996
65997
65998
65999
.....
67372
67373
67374
67375
67376
67377
67378

67379
67380
67381
67382
67383
67384
67385
67386
67387
67388
67389

67390
67391
67392
67393
67394
67395
67396
.....
67423
67424
67425
67426
67427
67428
67429

67430
67431
67432
67433
67434
67435
67436
.....
68264
68265
68266
68267
68268
68269
68270

68271
68272
68273
68274
68275
68276
68277
.....
68323
68324
68325
68326
68327
68328
68329

68330
68331
68332
68333
68334
68335
68336
.....
68444
68445
68446
68447
68448
68449
68450

68451
68452
68453
68454
68455
68456
68457
.....
69624
69625
69626
69627
69628
69629
69630

69631
69632
69633
69634
69635
69636
69637
.....
69706
69707
69708
69709
69710
69711
69712

69713
69714
69715
69716
69717
69718
69719
.....
69772
69773
69774
69775
69776
69777
69778

69779
69780
69781
69782
69783
69784
69785
.....
70183
70184
70185
70186
70187
70188
70189

70190
70191
70192
70193
70194
70195
70196
.....
70321
70322
70323
70324
70325
70326
70327

70328
70329
70330
70331
70332
70333
70334
.....
70681
70682
70683
70684
70685
70686
70687

70688
70689
70690
70691
70692
70693
70694
query I rowsort
SELECT DISTINCT col2 * - col2 AS col1 FROM tab1 GROUP BY col1, col2
----
-2025
-5041
-64


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

query I rowsort
SELECT DISTINCT - col0 * - col0 * col0 FROM tab2 GROUP BY col0
----
................................................................................
38
79

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


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

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


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

query I rowsort
SELECT col0 / - col0 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----
................................................................................
query I rowsort
SELECT ALL - col0 + - col0 FROM tab1 GROUP BY col0
----
-164
-44
-56


query II rowsort
SELECT ALL - col0 col2, - col0 FROM tab0 AS cor0 GROUP BY col0
----
-26
-26
-43
-43
................................................................................
57
6

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


query II rowsort
SELECT DISTINCT col2 col2, - col2 * - col2 FROM tab0 GROUP BY col1, col2
----
24
576
38
1444
................................................................................
86

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


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

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

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


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

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


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

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


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

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


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

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


query II rowsort
SELECT col1 col1, + col1 FROM tab2 GROUP BY col1
----
41
41
59
59
................................................................................
57
6

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


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

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


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

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


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

query I rowsort
SELECT ALL - + col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
................................................................................
query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83


query II rowsort
SELECT DISTINCT col2 col2, + col2 FROM tab1 GROUP BY col2, col0
----
45
45
71
71
................................................................................
query I rowsort
SELECT ALL col0 AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
15
91
92


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

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


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

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


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

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

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


query II rowsort
SELECT DISTINCT col2, AVG ( ALL - col2 ) * - - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL <= col1
----

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


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

query I rowsort
SELECT ALL col1 * - + col1 AS col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) >= NULL GROUP BY col1
----
................................................................................
-8
8

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


query II rowsort
SELECT col2 col2, col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
24
38
38
................................................................................
SELECT DISTINCT col1 + col1 col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col2
----

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


query II rowsort
SELECT - col0 col0, - col0 AS col0 FROM tab2 GROUP BY col0
----
-15
-15
-91
-91
................................................................................
query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING - + col2 IS NOT NULL
----
-44
-57
-6


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

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

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


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

query I rowsort
SELECT DISTINCT - col1 * - col1 FROM tab2 AS cor0 GROUP BY col1
----
................................................................................
16
90

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


query II rowsort
SELECT + col1 col2, + col1 AS col2 FROM tab1 cor0 GROUP BY col1, col1 HAVING NOT ( NULL ) IS NOT NULL
----
44
44
57
57
................................................................................
8281
8464

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


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

query I rowsort
SELECT ALL - + col2 + - + col0 AS col2 FROM tab0 cor0 GROUP BY col0, col2
----
................................................................................
59
61

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


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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 col1 FROM tab0 AS cor0 WHERE NOT col0 IS NULL GROUP BY col1
................................................................................
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 + + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL >= + - col1
----

query I rowsort
SELECT - - col0 * + + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
................................................................................
-210
30
-8190
182
-8372
184


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

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


query II rowsort
SELECT col1 col0, col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
41
59
59
................................................................................
query I rowsort label-2148
SELECT col1 / - col1 FROM tab2 GROUP BY col1
----
-1
-1
-1


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

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

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


query II rowsort
SELECT - - col1 col2, col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
82
57
28
................................................................................
query I rowsort
SELECT col1 + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88


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

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


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

query I rowsort
SELECT DISTINCT - + col2 * + - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
................................................................................
query I rowsort
SELECT ALL - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8


query II rowsort
SELECT col1 col2, col1 AS col0 FROM tab0 AS cor0 GROUP BY col1
----
0
0
81
81
................................................................................
-44
-56

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


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


query II rowsort
SELECT DISTINCT + + col0 col0, col0 FROM tab1 AS cor0 GROUP BY col0
----
22
22
28
28
................................................................................
query I rowsort
SELECT col0 * + - col0 * col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-3375
-753571
-778688


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

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

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


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


query II rowsort
SELECT ALL col2 - - + col1 col2, - col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
105
-24
38
-38
................................................................................
-650
-6806

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


query I rowsort
SELECT col1 * - col1 AS col2 FROM tab0 GROUP BY col1 HAVING col2 >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab1 GROUP BY col2, col1
................................................................................
184
30

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


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

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL BETWEEN col0 AND NULL
----
................................................................................
query I rowsort
SELECT ALL - col2 * - col2 FROM tab1 GROUP BY col2
----
2025
5041
64


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

query II rowsort
SELECT DISTINCT + + col2, + col2 + - 75 AS col0 FROM tab1 cor0 GROUP BY col2, col2 HAVING - col2 + - 17 IS NULL
----
................................................................................
query I rowsort
SELECT ALL col2 col0 FROM tab1 GROUP BY col2, col2
----
45
71
8


query II rowsort
SELECT - 4 col2, 1 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL IS NOT NULL
----
-4
1
-4
1
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-2858
SELECT DISTINCT - col2 col1, ( - 94 ) - - - 67 * + - col2 + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2 HAVING - col1 BETWEEN ( NULL ) AND NULL
----

skipif mysql # not compatible

query II rowsort label-2858
SELECT DISTINCT - col2 col1, ( - 94 ) - - - 67 * + - col2 + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2 HAVING - col1 BETWEEN ( NULL ) AND NULL
----

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


query II rowsort
SELECT ( + + col2 ) col2, - col2 * + - 32 AS col1 FROM tab2 AS cor0 WHERE col0 + + 83 IS NULL GROUP BY col2, col2, col2 HAVING NULL IN ( 70 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 * + 57 * col0 col2 FROM tab1 AS cor0 GROUP BY col0, col0, col0 HAVING NOT NULL NOT BETWEEN ( + col2 ) AND col2
................................................................................
query I rowsort label-2875
SELECT CASE - CAST( NULL AS SIGNED ) WHEN - col1 THEN + col0 - - 48 ELSE NULL END AS col2 FROM tab0 GROUP BY col1
----
NULL
NULL

skipif mysql # not compatible

query I rowsort label-2875
SELECT CASE - CAST ( NULL AS INTEGER ) WHEN - col1 THEN + col0 - - 48 ELSE NULL END AS col2 FROM tab0 GROUP BY col1
----
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
................................................................................
16
90

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


query II rowsort
SELECT ALL 76 + - col2 col2, col2 FROM tab2 GROUP BY col2
----
-11
87
-3
79
................................................................................
----

skipif mysql # not compatible
query II rowsort label-2938
SELECT + col1 - + ( - CAST ( NULL AS REAL ) ) + + + 71 * + ( - 27 ) AS col2, + col1 / + 63 - + col1 FROM tab2 GROUP BY col1 HAVING NULL > ( NULL )
----


query II rowsort
SELECT DISTINCT + col2 + - ( - col2 ) col1, 3 FROM tab1 GROUP BY col2
----
142
3
16
3
................................................................................
NULL
NULL

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2 HAVING NULL BETWEEN + 67 AND NULL
----


query I rowsort
SELECT DISTINCT CASE col2 WHEN - col2 THEN - AVG ( DISTINCT - col0 ) END AS col1 FROM tab1 cor0 GROUP BY col2 HAVING + col1 = NULL
----

query I rowsort
SELECT - col0 * - 93 FROM tab1 WHERE + col2 * + col1 * - 33 IS NULL GROUP BY col0
----
................................................................................
----

skipif mysql # not compatible
query I rowsort label-3063
SELECT ALL + col1 AS col0 FROM tab1 WHERE NULL > + + 71 * + - col2 + + col1 + - - CAST ( NULL AS INTEGER ) * col1 + + col2 + - col1 GROUP BY col0, col1
----


query I rowsort
SELECT ALL - col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1, col2 HAVING NOT NULL BETWEEN + - 33 * - - 38 + + col1 AND + col2 + - + col0
----

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

query I rowsort
SELECT DISTINCT - col0 * + 48 + col0 / 91 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( ( NULL ) IS NOT NULL )
----


query II rowsort
SELECT DISTINCT + col2 col2, col1 * + + col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) > col2 GROUP BY col2, col1, col0, col1
----

query I rowsort
SELECT - 40 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - + 13 + 52 IS NOT NULL
----
................................................................................
query I rowsort label-3199
SELECT ALL col1 / - col1 AS col2 FROM tab2 GROUP BY col1
----
-1
-1
-1


query II rowsort
SELECT - col2 * col1 - - ( + 11 ) * col0 * - col0 col1, col2 / - - 90 - - 82 FROM tab0 AS cor0 GROUP BY col2, col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 + col2 + + - col2 * - 10 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
................................................................................
456
948

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


query I rowsort
SELECT DISTINCT 55 * - col2 AS col1 FROM tab2 AS cor0 WHERE NOT NULL > NULL GROUP BY col2 HAVING NULL >= col1
----

query I rowsort
SELECT - col1 + + + 63 AS col0 FROM tab0 GROUP BY col1
----
................................................................................
-16
-91
-16
-92
-16

skipif mysql # not compatible

query II rowsort label-3207
SELECT + ( - col0 ) col1, + CAST ( - 16 AS INTEGER ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-16
-91
-16
................................................................................
query I rowsort
SELECT DISTINCT col0 - + - col0 FROM tab1 GROUP BY col0
----
164
44
56


query I rowsort
SELECT col1 + + col1 + 10 * - 81 * COALESCE ( 7, + 91 + col1 + ( + col2 ) ) + - - col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT ( col1 = NULL )
----

query I rowsort
SELECT - + 63 * 7 + - - col1 * col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3333
SELECT DISTINCT + col0 + COALESCE ( ( + 53 ), - CAST( NULL AS SIGNED ) * NULLIF ( - col2, - col1 ) ) AS col1 FROM tab1 WHERE ( - col0 ) = NULL GROUP BY col0, col2, col2
----

skipif mysql # not compatible

query I rowsort label-3333
SELECT DISTINCT + col0 + COALESCE ( ( + 53 ), - CAST ( NULL AS INTEGER ) * NULLIF ( - col2, - col1 ) ) AS col1 FROM tab1 WHERE ( - col0 ) = NULL GROUP BY col0, col2, col2
----

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


query I rowsort
SELECT COALESCE ( 50, col1 ) FROM tab1 GROUP BY col2 HAVING NOT NULL <= + - ( + - 58 ) + + + col2
----

query I rowsort
SELECT + + 54 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
................................................................................
query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING ( NOT NULL IS NOT NULL )
----
44
57
6


query II rowsort
SELECT + 52 * + col2 + - col2 col0, + col1 * - col1 FROM tab0 GROUP BY col1, col2
----
1224
-6561
1938
0
................................................................................
57
6

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab2 WHERE NOT NULL <= + 48 * + + 99 * + + col2 * + 45 GROUP BY col0 HAVING NOT + col0 IS NULL
----


query II rowsort
SELECT DISTINCT + 38, + COALESCE ( - - COALESCE ( - 46, + - col1 ), + 74 ) AS col0 FROM tab2 GROUP BY col0
----
38
-46

query I rowsort
................................................................................
query I rowsort
SELECT ALL ( - col2 ) + - - col2 - - 93 AS col0 FROM tab1 GROUP BY col2
----
93
93
93


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

query I rowsort
SELECT DISTINCT + col1 * 26 - + + col1 AS col0 FROM tab0 GROUP BY col1
----
................................................................................
query I rowsort
SELECT ALL ( - - col2 ) AS col1 FROM tab1 GROUP BY col2
----
45
71
8


query II rowsort
SELECT + col0 col1, 78 - - col0 - 65 + - + 50 * - + ( col2 ) FROM tab0 AS cor0 GROUP BY col2, col0
----
26
3989
43
1256
................................................................................
1

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


query I rowsort
SELECT ALL + - 75 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN - - col0 + 12 AND ( - 59 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3571
SELECT DISTINCT - - CAST( NULL AS SIGNED ) AS col1, col1 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING NOT ( ( NULL IS NULL ) )
................................................................................
SELECT ALL COALESCE ( - 83, + - ( col2 ) * - - col0 * CAST( + col1 AS SIGNED ) ) FROM tab1 GROUP BY col1
----
-83
-83
-83

skipif mysql # not compatible

query I rowsort label-3589
SELECT ALL COALESCE ( - 83, + - ( col2 ) * - - col0 * CAST ( + col1 AS INTEGER ) ) FROM tab1 GROUP BY col1
----
-83
-83
-83

................................................................................
query I rowsort label-3648
SELECT + col2 + - col2 * - ( CAST ( NULL AS INTEGER ) ) AS col1 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL


query II rowsort
SELECT + 35, + col2 * - 15 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL > - col1 * + 42 * - col0 + + col2 + - col1
----

query I rowsort
SELECT - + col0 / col0 FROM tab1 AS cor0 WHERE + 44 = + - col1 GROUP BY col1, col0, col1 HAVING NOT ( NULL ) NOT BETWEEN 61 AND ( NULL )
----
................................................................................
query I rowsort
SELECT DISTINCT + ( + 48 ) + - - 94 + + 86 * col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
2034
2550
7194


query I rowsort
SELECT - col1 * - col1 * - COALESCE ( 30, 14, - col0 + 5 ) FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL - 12 AS col1 FROM tab0 GROUP BY col2
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3701
SELECT DISTINCT - 14 - col0 AS col2 FROM tab1 AS cor0 WHERE NULL <> col2 - - col2 GROUP BY col0 HAVING NOT + CAST( - col2 AS SIGNED ) * col0 + - col2 / - 81 BETWEEN NULL AND NULL
----

skipif mysql # not compatible

query I rowsort label-3701
SELECT DISTINCT - 14 - col0 AS col2 FROM tab1 AS cor0 WHERE NULL <> col2 - - col2 GROUP BY col0 HAVING NOT + CAST ( - col2 AS INTEGER ) * col0 + - col2 / - 81 BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col1 + - col2 * col1 FROM tab1 GROUP BY col2, col1
----
................................................................................
SELECT - CAST ( 70 AS INTEGER ) / + col2 FROM tab1 WHERE NOT ( 46 ) IS NOT NULL GROUP BY col2 HAVING NULL IS NULL
----

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


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

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3714
SELECT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( - CAST( NULL AS SIGNED ) ) <= + 43
................................................................................
-1
67
-1
69
-1

skipif mysql # not compatible

query II rowsort label-3821
SELECT ALL 8 + - - col1 col2, col1 / - col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
49
-1
67
-1
................................................................................
query I rowsort
SELECT DISTINCT + 28 + - col2 * - col2 AS col0 FROM tab0 GROUP BY col2
----
1472
604
6269


query II rowsort
SELECT DISTINCT col0 col1, ( - col0 ) * - col0 AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND ( 65 )
----

query I rowsort
SELECT + col1 * - col0 + 76 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NULL < COALESCE ( - + col0, col0 ) AND ( NULL ) IS NOT NULL
----
................................................................................
SELECT + COALESCE ( 83, - - col0 DIV CASE col0 WHEN col1 THEN NULL WHEN col0 THEN - col1 END ) FROM tab1 AS cor0 GROUP BY col1
----
83
83
83

skipif mysql # not compatible

query I rowsort label-3916
SELECT + COALESCE ( 83, - - col0 / CASE col0 WHEN col1 THEN NULL WHEN col0 THEN - col1 END ) FROM tab1 AS cor0 GROUP BY col1
----
83
83
83

................................................................................

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-3946
SELECT DISTINCT col1 AS col0, - CAST( NULL AS DECIMAL ) + col1 AS col1 FROM tab0 GROUP BY col1, col1 HAVING + 22 * + 61 + - - col0 > NULL
----

skipif mysql # not compatible

query II rowsort label-3946
SELECT DISTINCT col1 AS col0, - CAST ( NULL AS REAL ) + col1 AS col1 FROM tab0 GROUP BY col1, col1 HAVING + 22 * + 61 + - - col0 > NULL
----

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col1, col1, col0 HAVING - col1 * - 13 + col0 + - 27 + - + 61 IS NULL
----
................................................................................
15
-44
15
-57
15
-6


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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT ( + col0 ) col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
................................................................................
query I rowsort label-4054
SELECT + CAST ( + + 96 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0, col1
----
96
96
96


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

onlyif mysql # DIV for integer division: 
query I rowsort label-4056
SELECT DISTINCT + col0 DIV - - col0 FROM tab2 GROUP BY col0, col0
................................................................................
query I rowsort
SELECT ALL + col2 * - 83 * NULLIF ( - 83, - 11 ) FROM tab2 AS cor0 GROUP BY col1, col2
----
399562
544231
599343


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

query I rowsort
SELECT col2 * - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
................................................................................
225
1
8281
1
8464

skipif mysql # not compatible

query II rowsort label-4219
SELECT ALL col0 / + col0 col1, + col0 * col0 FROM tab2 AS cor0 GROUP BY col0
----
1
225
1
8281
................................................................................
----

skipif mysql # not compatible
query I rowsort label-4228
SELECT ALL + ( col0 ) FROM tab1 GROUP BY col0, col2 HAVING NULL NOT IN ( + col2 / - - 92 / - col2 * - col0, + COALESCE ( + + CAST ( - - col2 AS INTEGER ), - col0 ) )
----


query II rowsort
SELECT ALL - + 75 col0, 23 FROM tab1 cor0 GROUP BY col2
----
-75
23
-75
23
................................................................................
1

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


query II rowsort
SELECT DISTINCT - + col1 * - col1 + + col1 col0, - 28 FROM tab0 cor0 GROUP BY col1, col1
----
0
-28
6642
-28
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4415
SELECT DISTINCT COALESCE ( + 90, ( 11 ) + - col1 * + CAST( NULL AS SIGNED ), col0 - col0 ) + - col0 FROM tab0 GROUP BY col0 HAVING NOT ( col0 ) <> NULL
----

skipif mysql # not compatible

query I rowsort label-4415
SELECT DISTINCT COALESCE ( + 90, ( 11 ) + - col1 * + CAST ( NULL AS INTEGER ), col0 - col0 ) + - col0 FROM tab0 GROUP BY col0 HAVING NOT ( col0 ) <> NULL
----

query I rowsort
SELECT 52 FROM tab0 GROUP BY col1, col0, col1 HAVING col0 <= ( NULL )
----
................................................................................
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0 HAVING + CAST ( ( col0 ) AS INTEGER ) IS NULL
----

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


query I rowsort
SELECT + col1 * 98 * + COALESCE ( + 7, - col2 ) - col1 * col1 AS col1 FROM tab0 GROUP BY col1
----
0
49005

onlyif mysql # DIV for integer division: 
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4506
SELECT ALL - col0 + + col0 AS col1 FROM tab0 WHERE col1 IN ( CAST( col0 AS SIGNED ) ) GROUP BY col0 HAVING NOT CAST( NULL AS SIGNED ) <= ( - col1 + + col1 )
----

skipif mysql # not compatible

query I rowsort label-4506
SELECT ALL - col0 + + col0 AS col1 FROM tab0 WHERE col1 IN ( CAST ( col0 AS INTEGER ) ) GROUP BY col0 HAVING NOT CAST ( NULL AS INTEGER ) <= ( - col1 + + col1 )
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 GROUP BY col0, col0
----
................................................................................
query I rowsort label-4548
SELECT DISTINCT CAST ( ( - 67 ) AS INTEGER ) + + - col0 FROM tab1 cor0 GROUP BY col0, col2
----
-149
-89
-95


query II rowsort
SELECT DISTINCT - + col2 * col2 + - ( col1 ) col0, col2 * col2 * col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-1444
54872
-6241
493039
................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4558
SELECT DISTINCT CASE - 59 WHEN 88 THEN - col0 * + + col2 + - 25 + - + CAST( + col0 AS SIGNED ) END AS col1 FROM tab2 AS cor0 GROUP BY col1
----
NULL

skipif mysql # not compatible

query I rowsort label-4558
SELECT DISTINCT CASE - 59 WHEN 88 THEN - col0 * + + col2 + - 25 + - + CAST ( + col0 AS INTEGER ) END AS col1 FROM tab2 AS cor0 GROUP BY col1
----
NULL

query I rowsort
SELECT - + 68 FROM tab1 AS cor0 GROUP BY col0, col1, col2
................................................................................
NULL
91
NULL
92
NULL

skipif mysql # not compatible

query II rowsort label-4572
SELECT col0 col2, CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0
----
15
NULL
91
NULL
................................................................................
query I rowsort
SELECT + + col1 * 56 FROM tab1 AS cor0 GROUP BY col1, col1
----
2464
3192
336


query I rowsort
SELECT DISTINCT - 7 * + col1 * - col1 AS col0 FROM tab0 GROUP BY col1 HAVING NULL >= - col0
----

query I rowsort
SELECT - 33 FROM tab2 GROUP BY col2
----
................................................................................
44
NULL
57
NULL
6

skipif mysql # not compatible

query II rowsort label-4586
SELECT ALL CAST ( NULL AS INTEGER ) - col1 * - AVG ( + 13 ) col0, col1 AS col2 FROM tab1 GROUP BY col1, col1
----
NULL
44
NULL
57
................................................................................
query I rowsort
SELECT + col1 * + 99 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
0
8019


query I rowsort
SELECT ALL + COALESCE ( + + ( + 22 ), + - 99 * + - CASE + - col0 WHEN - col0 THEN - col2 ELSE NULL END * + col0 - + col0 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
22
22
22

................................................................................
SELECT col2 AS col2 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 7 + - col1 FROM tab0 GROUP BY col1, col0, col2 HAVING NOT NULL BETWEEN + - COALESCE ( + - 37, - col1 - - + col1 ) AND col1
----


query II rowsort
SELECT DISTINCT col2 + + CASE + - 82 WHEN - 28 THEN - col0 + - col2 END AS col1, - col1 / + col1 FROM tab0 GROUP BY col1, col2 HAVING + col1 > col1
----

query II rowsort
SELECT - col0 AS col0, 54 AS col0 FROM tab2 GROUP BY col0, col0, col0
----
................................................................................
SELECT DISTINCT - ( + - col2 ) FROM tab2 cor0 GROUP BY col2, col0 HAVING NULL < + + col0
----

query I rowsort
SELECT col1 * + + col1 FROM tab2 cor0 GROUP BY col0, col1, col1 HAVING NOT + 56 > + 45
----


query I rowsort
SELECT ALL col1 AS col0 FROM tab0 AS cor0 WHERE NOT + 58 * + 43 IS NULL GROUP BY col1 HAVING NOT NULL NOT BETWEEN col0 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4677
SELECT - col1 - + + CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING ( - col0 * + + col0 + - col1 ) IS NOT NULL
................................................................................
query I rowsort
SELECT - 30 FROM tab1 GROUP BY col2, col1
----
-30
-30
-30


query II rowsort
SELECT ALL 13 col0, - col2 AS col0 FROM tab0 GROUP BY col2
----
13
-24
13
-38
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4694
SELECT DISTINCT col0 - col1, col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING ( NULL ) <> + col2 - + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible

query II rowsort label-4694
SELECT DISTINCT col0 - col1, col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING ( NULL ) <> + col2 - + CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT - col2 * - + col2 * 85 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
................................................................................
query I rowsort
SELECT DISTINCT - + 78 + col1 col0 FROM tab2 cor0 GROUP BY col1, col2
----
-17
-19
-37


query I rowsort
SELECT + 85 * - + col2 + - - col2 + 54 + + 58 + - col2 * + col2 * - col2 / + - col2 AS col0 FROM tab2 cor0 GROUP BY col2 HAVING NOT 79 * - + col2 * - col0 >= NULL
----

query I rowsort
SELECT ALL + 83 FROM tab0 GROUP BY col2, col0
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4864
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL = ( col0 + 42 * - CAST( + 33 AS SIGNED ) )
----

skipif mysql # not compatible

query I rowsort label-4864
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL = ( col0 + 42 * - CAST ( + 33 AS INTEGER ) )
----

query I rowsort
SELECT ALL 15 AS col0 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NULL
----
................................................................................
SELECT + COALESCE ( + 85, col0 DIV + ( col2 ) ) FROM tab0 AS cor0 GROUP BY col0
----
85
85
85

skipif mysql # not compatible

query I rowsort label-4887
SELECT + COALESCE ( + 85, col0 / + ( col2 ) ) FROM tab0 AS cor0 GROUP BY col0
----
85
85
85

................................................................................
SELECT DISTINCT + - AVG ( + - col0 ) AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

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


query II rowsort
SELECT + + 80 * + col1 col2, ( - col1 ) FROM tab1 AS cor0 GROUP BY col2, col1
----
3520
-44
4560
-57
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4915
SELECT DISTINCT + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL < - col2 * CAST( col2 AS SIGNED )
----

skipif mysql # not compatible

query I rowsort label-4915
SELECT DISTINCT + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL < - col2 * CAST ( col2 AS INTEGER )
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 GROUP BY col0, col1
----
................................................................................
query I rowsort
SELECT col1 + + 27 + + 19 * - col2 AS col0 FROM tab0 GROUP BY col1, col2
----
-1474
-348
-695


query II rowsort
SELECT col0 col0, col0 FROM tab0 GROUP BY col0, col0
----
26
26
43
43
................................................................................
query I rowsort
SELECT + 14 FROM tab0 cor0 GROUP BY col0
----
14
14
14


query I rowsort
SELECT col1 * + col1 * - col1 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL BETWEEN col0 AND - - NULLIF ( col0, col0 * - col2 / + col0 )
----

query I rowsort
SELECT ALL - 29 * - col1 - - col1 * + - 39 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
................................................................................
query I rowsort
SELECT DISTINCT + 16 * + col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
1264
1392
928


query II rowsort
SELECT ALL + 6 col1, - 40 FROM tab2 GROUP BY col0 HAVING NULL NOT IN ( - col1 * col1 * - col1 - - + 84, 62 - + 15 * + col1 )
----

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


query II rowsort
SELECT DISTINCT ( - + col1 ) AS col2, + 69 * col1 + - + AVG ( DISTINCT - col1 ) + + 17 AS col2 FROM tab0 GROUP BY col1 HAVING NOT 42 * - col2 = NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5024
SELECT - - col0 + CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) AS col1, col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL > - 21
................................................................................
query I rowsort label-5060
SELECT ALL - 84 + - + col2 + - col2 / - col2 col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT col2 IS NULL
----
-107
-121
-162


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


query II rowsort
SELECT col1 col1, col1 FROM tab1 GROUP BY col1
----
44
44
57
57
................................................................................
-1

query I rowsort
SELECT DISTINCT - 22 AS col0 FROM tab1 WHERE NOT - ( + COALESCE ( - + 77, + - 49 ) ) + - ( + - 33 ) + col0 IN ( + 35 ) GROUP BY col1
----
-22


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

query I rowsort
................................................................................
SELECT ALL - col2 FROM tab0 AS cor0 WHERE NULL = NULL AND - 24 * - COALESCE ( + col1, COALESCE ( 61, 72 * ( + col0 * col0 ), 55 ) + - col1, + 46 ) < + col1 GROUP BY col2, col1 HAVING NULL NOT IN ( + 62 )
----

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


query I rowsort
SELECT - - col1 - CASE ( + - col1 ) WHEN + - 2 THEN + 56 END col0 FROM tab2 cor0 GROUP BY col1
----
NULL
NULL
NULL

................................................................................
query I rowsort label-5208
SELECT ALL - col1 * col1 + 29 + - - col1 / + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-1653
-3453
-3693


query III rowsort
SELECT col2 / - col2 + col2 * - col2 AS col1, 67 col1, 24 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
9 values hashing to 442b706f32baefbb061d0cc9d3a2d7a7

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

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5293
SELECT 59 col0, + CAST( - col0 AS SIGNED ) AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible

query II rowsort label-5293
SELECT 59 col0, + CAST ( - col0 AS INTEGER ) AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

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

skipif mysql # not compatible
query II rowsort label-5304
SELECT - col0 / - 47 + - + col0 AS col0, col0 AS col1 FROM tab2 AS cor0 WHERE NOT - CAST ( NULL AS INTEGER ) IS NULL GROUP BY col0 HAVING NULL > - 30 + - CAST ( NULL AS INTEGER )
----


query II rowsort
SELECT DISTINCT - 1, 9 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NOT - 76 = - ( col2 ) + COALESCE ( + + 86, + + col0 )
----
-1
9

query I rowsort
................................................................................
SELECT - + col1 * + col1 * + NULLIF ( - CAST( NULL AS SIGNED ), + - 27 * + + NULLIF ( - col0, col1 * 9 ) ) + - + 78 + col1 + - + col1 * 26 / col1 / + AVG ( ALL + 6 ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible

query I rowsort label-5317
SELECT - + col1 * + col1 * + NULLIF ( - CAST ( NULL AS INTEGER ), + - 27 * + + NULLIF ( - col0, col1 * 9 ) ) + - + 78 + col1 + - + col1 * 26 / col1 / + AVG ( ALL + 6 ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

................................................................................
query I rowsort
SELECT DISTINCT col0 - col0 * - 65 FROM tab0 AS cor0 GROUP BY col0
----
1716
2838
5478


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

query I rowsort
SELECT col2 + + col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
................................................................................
query I rowsort
SELECT DISTINCT + col0 * + 56 FROM tab2 AS cor0 GROUP BY col0, col2
----
5096
5152
840


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

onlyif mysql # DIV for integer division: 
query II rowsort label-5508
SELECT col0 DIV - 46 AS col1, col0 + - - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT 33 IS NULL
................................................................................
----
3

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


query II rowsort
SELECT DISTINCT - - 2 * - + col2 col0, ( - col1 ) + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL <= + col2
----

query I rowsort
SELECT - - col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT - 93 NOT BETWEEN - col1 / - 99 AND NULL
----
................................................................................
query I rowsort
SELECT 76 FROM tab2 GROUP BY col2
----
76
76
76


query II rowsort
SELECT ALL col1 / + 8 col1, col1 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NOT ( NULL ) <> col0
----

query II rowsort
SELECT ALL col2 * col1 + + - col2 AS col1, + 71 / - col1 * - COALESCE ( + col2, + col1 + - col1 ) AS col2 FROM tab1 GROUP BY col1, col2 HAVING NULL <= 4
----
................................................................................
-118
-98

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


query III rowsort
SELECT DISTINCT 20 + - col2 AS col0, + col2 col0, - 95 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
9 values hashing to 44912f0b8cb9b18845e83ac435de9c5f

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5636
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5669
SELECT ALL CAST( 59 AS SIGNED ) AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL BETWEEN col1 * - 34 AND NULL
----

skipif mysql # not compatible

query I rowsort label-5669
SELECT ALL CAST ( 59 AS INTEGER ) AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL BETWEEN col1 * - 34 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5670
SELECT ALL + 68 * - CAST( NULL AS SIGNED ) / + col2 * - + col2 AS col0, col2 * + col2 - 2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
................................................................................
SELECT + 34 + - col0 + COALESCE ( 7, 29 * col0, + col0 * + CAST( 29 * + col2 AS SIGNED ) ) * col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-49
558
8

skipif mysql # not compatible

query I rowsort label-5709
SELECT + 34 + - col0 + COALESCE ( 7, 29 * col0, + col0 * + CAST ( 29 * + col2 AS INTEGER ) ) * col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-49
558
8

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


query II rowsort
SELECT - col1 + + 77, col1 * + - 34 AS col2 FROM tab2 GROUP BY col1 HAVING col2 BETWEEN ( NULL ) AND ( NULL )
----

query I rowsort
SELECT DISTINCT 2 AS col0 FROM tab0 GROUP BY col1
----
................................................................................

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5719
SELECT ALL + col2 * 94 - + 68 + - + col2 * col2 + - + CASE - 2 WHEN - CAST( + 60 AS DECIMAL ) THEN + 38 END AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NULL <= + + col1
----

skipif mysql # not compatible

query I rowsort label-5719
SELECT ALL + col2 * 94 - + 68 + - + col2 * col2 + - + CASE - 2 WHEN - CAST ( + 60 AS REAL ) THEN + 38 END AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NULL <= + + col1
----

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


query II rowsort
SELECT 47 + - + col2 col2, 17 FROM tab0 GROUP BY col2 HAVING NOT col2 >= AVG ( - 86 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5751
SELECT - col0 * + - col0 AS col2 FROM tab2 AS cor0 WHERE - col0 IN ( - col1, - col0, + col2, + - 36 * + 54 * + CAST( - col0 AS SIGNED ), - col2 + - ( - col1 ), col1 ) GROUP BY col2, col0
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5790
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT ( col0 * + CAST( 14 / + col0 AS SIGNED ) > NULL )
----

skipif mysql # not compatible

query I rowsort label-5790
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT ( col0 * + CAST ( 14 / + col0 AS INTEGER ) > NULL )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5791
SELECT - CAST( NULL AS DECIMAL ) FROM tab2 GROUP BY col1, col1
................................................................................
SELECT 12 AS col2 FROM tab0 GROUP BY col0, col1, col2 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT + 11 * + - col0 * - col0 / - 97 FROM tab2 cor0 WHERE col2 IS NULL GROUP BY col0
----


query II rowsort
SELECT DISTINCT + col1 * 84 + ( + - 68 ) col1, col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + 0 FROM tab0 AS cor0 GROUP BY col2
----
................................................................................
query I rowsort
SELECT ALL col0 + 9 FROM tab1 AS cor0 GROUP BY col0
----
31
37
91


query II rowsort
SELECT 59 col0, - col2 AS col0 FROM tab1 GROUP BY col2
----
59
-45
59
-71
................................................................................
query I rowsort
SELECT + col0 * 79 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
1738
2212
6478


query I rowsort
SELECT DISTINCT col2 * + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col2 HAVING NULL >= ( col2 + - 30 * col0 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5924
SELECT DISTINCT col1 - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - CAST( NULL AS SIGNED ) / - col1 + + col1 <> NULL
................................................................................
query I rowsort
SELECT 48 FROM tab1 GROUP BY col2
----
48
48
48


query I rowsort
SELECT ( col2 ) AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL <> + 14 / - col2 * 34 + 1 + - col1 / col1 * col2
----

query I rowsort
SELECT ALL 86 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
................................................................................
query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 GROUP BY col1, col0
----
-22
-28
-82


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

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6089
SELECT DISTINCT + CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 WHERE - 29 IS NULL GROUP BY col0, col2 HAVING + col2 IS NULL
................................................................................
----

skipif mysql # not compatible
query I rowsort label-6089
SELECT DISTINCT + CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 WHERE - 29 IS NULL GROUP BY col0, col2 HAVING + col2 IS NULL
----


query I rowsort
SELECT ALL + COALESCE ( 47, col2 ) FROM tab0 AS cor0 GROUP BY col0, col0
----
47
47
47

................................................................................
49
49

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


query II rowsort
SELECT - ( - 68 ) col2, col2 * - 47 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 WHERE NULL BETWEEN + + col2 AND NULL GROUP BY col1
----
................................................................................
query I rowsort label-6116
SELECT - + 76 / col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-9


query II rowsort
SELECT + - col1 col0, + col1 * col1 FROM tab0 WHERE - + 42 NOT BETWEEN + ( + + col0 ) AND + col0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
6561
0
0
................................................................................
-12
-88

query I rowsort
SELECT - 86 AS col0 FROM tab1 AS cor0 WHERE NOT NULL BETWEEN - 11 + 20 AND - + col2 GROUP BY col2
----


query II rowsort
SELECT DISTINCT col0 col2, - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0
----
15
-15
91
-91
................................................................................
77
78

query II rowsort
SELECT - - 9 * + - 82, 98 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----


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

query II rowsort
SELECT ALL + col0, col0 FROM tab2 GROUP BY col0 HAVING 46 IS NULL
----
................................................................................

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


query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL <> + NULLIF ( - col0, 49 ) + - 92
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * col1 col2 FROM tab1 AS cor0 GROUP BY col1
................................................................................
query I rowsort label-6212
SELECT col0 * col0 / + col0 FROM tab2 GROUP BY col0 HAVING ( ( + 13 ) - - col0 ) <> + 39 - - col0 + - 79 * - 78
----
15
91
92


query I rowsort
SELECT ALL - + col1 * 63 + + 89 * + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1, col2 HAVING NULL >= - + col0 / + col1
----

query I rowsort
SELECT col1 - + col1 * - - ( col1 ) AS col0 FROM tab1 GROUP BY col1
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6239
SELECT ALL + col2 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT ( + 1 ) IN ( + CASE + ( col0 ) WHEN 79 * + CAST( NULL AS SIGNED ) THEN col1 END )
----

skipif mysql # not compatible

query I rowsort label-6239
SELECT ALL + col2 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT ( + 1 ) IN ( + CASE + ( col0 ) WHEN 79 * + CAST ( NULL AS INTEGER ) THEN col1 END )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6240
SELECT + col1 - + 72 DIV + 35 + + col1 AS col1 FROM tab0 GROUP BY col1, col0, col2
................................................................................
SELECT + - 5 * + + NULLIF ( + CAST( NULL AS SIGNED ), - NULLIF ( col0, col0 * CAST( + 64 AS SIGNED ) ) * 91 + - col1 ) FROM tab0 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible

query I rowsort label-6255
SELECT + - 5 * + + NULLIF ( + CAST ( NULL AS INTEGER ), - NULLIF ( col0, col0 * CAST ( + 64 AS INTEGER ) ) * 91 + - col1 ) FROM tab0 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

................................................................................
----
6111
-30
6111
-5

skipif mysql # not compatible

query II rowsort label-6283
SELECT DISTINCT 97 * + 63 col1, - col0 / - - 3 AS col1 FROM tab2 GROUP BY col0, col0
----
6111
-30
6111
-5
................................................................................
query I rowsort
SELECT + + col2 - + col1 col2 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
-57
38
79


query I rowsort
SELECT DISTINCT - 21 + + col1 + - 41 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING + 44 + + col2 NOT BETWEEN NULL AND ( NULL )
----

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

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-6416
SELECT ALL col2 col2, col2 FROM tab2 WHERE CAST( NULL AS DECIMAL ) >= + col1 GROUP BY col2
----

skipif mysql # not compatible

query II rowsort label-6416
SELECT ALL col2 col2, col2 FROM tab2 WHERE CAST ( NULL AS REAL ) >= + col1 GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 col1 FROM tab1 cor0 GROUP BY col0
................................................................................
query I rowsort label-6420
SELECT DISTINCT ( + 4 ) + - col2 / + 17 FROM tab2 GROUP BY col2
----
-1
0
1


query I rowsort
SELECT ALL col2 + - 55 + 50 * - + ( + col2 ) AS col1 FROM tab2 GROUP BY col2 HAVING - + col1 > NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6422
SELECT DISTINCT - 45 DIV + col1 col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
................................................................................
query I rowsort
SELECT + + ( - col2 ) col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8


query II rowsort
SELECT ALL col1 col2, - col1 * col1 FROM tab0 GROUP BY col1
----
0
0
81
-6561
................................................................................
query I rowsort
SELECT col0 + 70 FROM tab0 GROUP BY col0, col2
----
113
153
96


query I rowsort
SELECT CASE - - 38 WHEN + col1 THEN - col2 END col0 FROM tab1 GROUP BY col1, col2, col1
----
NULL
NULL
NULL

................................................................................
-43
-83

query II rowsort
SELECT ALL col0 * - col2 * + col0 * - + 98, - col2 + - 70 AS col1 FROM tab2 GROUP BY col0, col2 HAVING ( NOT - - col0 IS NOT NULL )
----


query II rowsort
SELECT - col0 + - col0 - + - 24 col2, col0 + - 19 FROM tab1 cor0 GROUP BY col0 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT 31 * - col2 + + - 17 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
................................................................................
51
51

query I rowsort
SELECT ALL 8 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT ( NULL ) <> - 78
----


query I rowsort
SELECT - COALESCE ( + 10, - - col2 + - 67, - + 99 ) * + 93 FROM tab1 GROUP BY col0, col0
----
-930
-930
-930

................................................................................
query I rowsort label-6659
SELECT + ( - CAST ( NULL AS INTEGER ) ) + 36 * - - 0 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL


query II rowsort
SELECT col0 * - col2 col2, col0 AS col2 FROM tab2 GROUP BY col2, col0 HAVING 93 / col2 + - col2 IS NOT NULL
----
-1305
15
-5336
92
................................................................................
NULL
-1
NULL
-1
NULL

skipif mysql # not compatible

query II rowsort label-6688
SELECT ALL col1 / - col1, + CASE + - 33 WHEN + 66 THEN col0 + + col2 + - - col1 + - - col0 * + col0 ELSE NULL END AS col0 FROM tab2 GROUP BY col1
----
-1
NULL
-1
NULL
................................................................................
----
1

query I rowsort
SELECT ALL col0 + - col0 AS col1 FROM tab0 WHERE col1 + col0 < ( NULL ) GROUP BY col0 HAVING - 63 BETWEEN + col0 AND + col0
----


query I rowsort
SELECT ALL + col1 AS col0 FROM tab1 GROUP BY col1 HAVING NULL NOT BETWEEN ( - 66 * + col0 ) AND NULL
----

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING NOT 71 >= NULL
----
................................................................................
30
30

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 cor0 WHERE ( - 88 ) NOT BETWEEN NULL AND NULL GROUP BY col0 HAVING NULL = ( - 15 )
----


query II rowsort
SELECT - + col1 col1, 66 FROM tab1 cor0 GROUP BY col1 HAVING NOT ( col1 ) NOT BETWEEN NULL AND - 0
----

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL >= 17
----
................................................................................
query I rowsort
SELECT + 45 - - col0 AS col1 FROM tab2 GROUP BY col0
----
136
137
60


query I rowsort
SELECT 19 AS col2 FROM tab2 GROUP BY col0, col1, col1 HAVING NULL NOT BETWEEN + - NULLIF ( + - col2, - + ( + 2 ) ) AND + col2
----

query I rowsort
SELECT 21 AS col0 FROM tab2 GROUP BY col2
----
................................................................................
-74

query I rowsort
SELECT DISTINCT - 54 FROM tab1 cor0 GROUP BY col0
----
-54


query II rowsort
SELECT ALL + col1 col1, col1 + - col1 FROM tab1 GROUP BY col1
----
44
0
57
0
................................................................................

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


query II rowsort
SELECT DISTINCT 1 - + ( + - 97 ) col0, - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL > ( NULL )
----

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

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-6908
SELECT - + ( CAST( + + CAST( - col0 AS DECIMAL ) AS SIGNED ) ) + - + COALESCE ( - + 27, + - col1, + col0 ) * + col0 + - ( + col0 ) - - 6 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN - col2 + - 97 * - col2 AND - ( col2 )
----

skipif mysql # not compatible

query I rowsort label-6908
SELECT - + ( CAST ( + + CAST ( - col0 AS REAL ) AS INTEGER ) ) + - + COALESCE ( - + 27, + - col1, + col0 ) * + col0 + - ( + col0 ) - - 6 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN - col2 + - 97 * - col2 AND - ( col2 )
----

query I rowsort
SELECT DISTINCT - col2 FROM tab2 cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----
................................................................................
SELECT DISTINCT + col0 FROM tab2 AS cor0 WHERE NOT ( NOT + 74 < col0 * + col1 + + 95 ) GROUP BY col0, col0 HAVING NOT NULL > - 40
----

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


query II rowsort
SELECT + 20 AS col2, - COALESCE ( + 41, - + col0 + + + 75 ) / + - 8 * - ( - col2 ) AS col2 FROM tab2 WHERE + 73 IS NOT NULL GROUP BY col2, col2 HAVING + 58 * 6 BETWEEN NULL AND + col2
----

query II rowsort
SELECT ALL 46, + col0 FROM tab1 GROUP BY col2, col0
----
................................................................................

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-6993
SELECT 49 col2, + col0 / + - 43 - - 14 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) < + - 27 - + NULLIF ( - + col0, CAST( + col0 AS DECIMAL ) )
----

skipif mysql # not compatible

query II rowsort label-6993
SELECT 49 col2, + col0 / + - 43 - - 14 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) < + - 27 - + NULLIF ( - + col0, CAST ( + col0 AS REAL ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6994
SELECT - ( - + 16 ) / + CAST( NULL AS SIGNED ) * + 20 FROM tab2 GROUP BY col0, col0
................................................................................
----

query I rowsort
SELECT DISTINCT - ( + 21 ) * + - 48 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
1008


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

query I rowsort
SELECT ALL + - 94 + col1 + col1 * - ( + 16 ) FROM tab1 cor0 GROUP BY col1
----
................................................................................
query I rowsort label-7059
SELECT ALL + - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1 HAVING + col1 IS NOT NULL
----
NULL
NULL
NULL


query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 AS cor0 WHERE NOT ( - col2 + - ( + + col1 ) + + col0 + 31 * - ( + col0 ) ) BETWEEN NULL AND 52 GROUP BY col2 HAVING NULL <= - 87 * - col0 + - 59
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7061
SELECT DISTINCT + - CAST( NULL AS SIGNED ) * - - col0 FROM tab0 cor0 GROUP BY col0
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7086
SELECT - col1 col2, 69 / - CAST( NULL AS SIGNED ) AS col1 FROM tab0 WHERE NOT NULL NOT BETWEEN - col2 AND + col1 GROUP BY col1
----

skipif mysql # not compatible

query II rowsort label-7086
SELECT - col1 col2, 69 / - CAST ( NULL AS INTEGER ) AS col1 FROM tab0 WHERE NOT NULL NOT BETWEEN - col2 AND + col1 GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7087
SELECT + col0 + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col0
................................................................................
SELECT ( + CASE CAST( NULL AS SIGNED ) WHEN - - col1 THEN 0 / col1 END ) FROM tab1 WHERE + col2 IS NOT NULL GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible

query I rowsort label-7107
SELECT ( + CASE CAST ( NULL AS INTEGER ) WHEN - - col1 THEN 0 / col1 END ) FROM tab1 WHERE + col2 IS NOT NULL GROUP BY col0, col0
----
NULL
NULL
NULL

................................................................................
query I rowsort
SELECT ALL + col2 + + 37 FROM tab0 AS cor0 GROUP BY col2, col2
----
116
61
75


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

query I rowsort
SELECT 90 AS col2 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL BETWEEN NULL AND NULL
----
................................................................................
query I rowsort
SELECT ALL 7 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
7
7
7


query I rowsort
SELECT ALL + COALESCE ( col1, + + 68, ( + col2 ) ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

................................................................................
624
988

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


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

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

skipif mysql # not compatible
query I rowsort label-7381
SELECT DISTINCT ( - CAST ( - - 52 AS INTEGER ) ) * - col1 + 7 * - 23 + col1 AS col1 FROM tab2 GROUP BY col1, col1, col0, col2 HAVING NOT + CAST ( - col2 AS REAL ) BETWEEN NULL AND ( - col0 + + col1 )
----


query I rowsort
SELECT - 49 AS col1 FROM tab1 WHERE + + 47 + + - col1 > NULL GROUP BY col2 HAVING NULL NOT BETWEEN - col1 AND ( - 53 + 29 )
----

query I rowsort
SELECT DISTINCT col1 + + 9 FROM tab0 GROUP BY col1
----
................................................................................
----
1944

query I rowsort
SELECT ALL - col1 + col1 * - col1 FROM tab1 AS cor0 WHERE 48 * - col1 IN ( 70 / 93 ) GROUP BY col1
----


query I rowsort
SELECT + COALESCE ( 69, + col2 - - col2, col2 ) * - COALESCE ( - col0, + col0 ) FROM tab1 GROUP BY col0 HAVING NOT + 0 <> ( + 57 )
----

query I rowsort
SELECT - 55 AS col0 FROM tab0 GROUP BY col1 HAVING NOT + 91 IS NULL
----
................................................................................
----
-1

query I rowsort
SELECT DISTINCT + col0 * col0 + - 81 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col0 HAVING NOT AVG ( ALL 21 ) IS NOT NULL
----


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

onlyif mysql # DIV for integer division: 
query I rowsort label-7407
SELECT ALL - - col2 DIV + col2 + - COALESCE ( + 98 + - 95, col1 ) FROM tab2 cor0 GROUP BY col2
----
-2
-2
-2

skipif mysql # not compatible

query I rowsort label-7407
SELECT ALL - - col2 / + col2 + - COALESCE ( + 98 + - 95, col1 ) FROM tab2 cor0 GROUP BY col2
----
-2
-2
-2

................................................................................
query I rowsort
SELECT COALESCE ( - 54, - 75 ) FROM tab0 AS cor0 GROUP BY col2
----
-54
-54
-54


query II rowsort
SELECT col0, 75 * col2 AS col1 FROM tab2 GROUP BY col2, col0 HAVING NOT + col1 < NULL
----

query I rowsort
SELECT DISTINCT 89 AS col1 FROM tab0 GROUP BY col1, col1
----
................................................................................
SELECT col2 + - col2 + + COALESCE ( ( - 39 ), + ( + NULLIF ( + + CAST( + CAST( col2 AS SIGNED ) AS SIGNED ), - - col0 * ( 79 ) ) ) + col2, - + col2 * - col2 ) FROM tab0 GROUP BY col2, col2
----
-39
-39
-39

skipif mysql # not compatible

query I rowsort label-7456
SELECT col2 + - col2 + + COALESCE ( ( - 39 ), + ( + NULLIF ( + + CAST ( + CAST ( col2 AS INTEGER ) AS INTEGER ), - - col0 * ( 79 ) ) ) + col2, - + col2 * - col2 ) FROM tab0 GROUP BY col2, col2
----
-39
-39
-39

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


query I rowsort
SELECT CASE 42 WHEN - 99 THEN AVG ( 13 ) * - col1 - + col2 * + col2 END + + col2 FROM tab0 WHERE ( NULL ) NOT BETWEEN ( col1 ) AND ( - CASE WHEN col2 NOT BETWEEN NULL AND ( col2 + 48 ) THEN col1 ELSE + col2 * + col0 END ) GROUP BY col2 HAVING NOT NULL BETWEEN ( - col2 ) AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7512
SELECT ALL col0 / - COALESCE ( 87 * - 29, NULLIF ( col0, - col1 ) * - col1 + col0 ) FROM tab2 WHERE NOT col1 NOT BETWEEN - 11 + - CAST( NULL AS SIGNED ) * - CAST( - col1 AS SIGNED ) AND col0 GROUP BY col0, col0
----

skipif mysql # not compatible

query I rowsort label-7512
SELECT ALL col0 / - COALESCE ( 87 * - 29, NULLIF ( col0, - col1 ) * - col1 + col0 ) FROM tab2 WHERE NOT col1 NOT BETWEEN - 11 + - CAST ( NULL AS INTEGER ) * - CAST ( - col1 AS INTEGER ) AND col0 GROUP BY col0, col0
----

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


query II rowsort
SELECT col0 + + 0 col0, col0 * + ( 52 ) FROM tab1 GROUP BY col0 HAVING - 58 < ( 2 + - 41 )
----
22
1144
28
1456
................................................................................
query I rowsort
SELECT 99 + col1 FROM tab2 GROUP BY col1, col1
----
140
158
160


query II rowsort
SELECT - col0 * - col0 * + col0 * + + col0 * col0 AS col0, col0 AS col1 FROM tab2 GROUP BY col0, col0 HAVING NOT NULL <= + col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7564
SELECT ALL col0 * + CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) FROM tab2 cor0 GROUP BY col0
................................................................................
-24
24
-38
38
-79
79


query II rowsort
SELECT - col0 col1, + 16 FROM tab2 GROUP BY col0, col1
----
-15
16
-91
16
................................................................................
----

skipif mysql # not compatible
query I rowsort label-7609
SELECT ALL + CAST ( - 27 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL >= - 26
----


query I rowsort
SELECT DISTINCT - COALESCE ( - - 86, - + COALESCE ( col0, col1 + - col1 ) * - - ( + col0 ) ) AS col2 FROM tab0 GROUP BY col2
----
-86

query I rowsort
SELECT + 29 - + - col1 + - - 54 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
................................................................................
query I rowsort label-7652
SELECT - CAST ( NULL AS INTEGER ) col2 FROM tab0 GROUP BY col2, col0
----
NULL
NULL
NULL


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

query I rowsort
SELECT ALL 57 FROM tab0 AS cor0 GROUP BY col1 HAVING col1 IS NOT NULL
----
................................................................................
SELECT col0 FROM tab0 GROUP BY col0 HAVING NOT ( NOT + 55 * 56 <= NULL )
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 WHERE NULL IN ( - col1 ) GROUP BY col0, col1
----


query II rowsort
SELECT ALL + COALESCE ( 34, - col1 * - col0 + + + 60 ), 32 AS col1 FROM tab0 cor0 GROUP BY col2, col0 HAVING + 30 > - col0 * 14
----
34
32
34
32
................................................................................
SELECT - col2 / col2 * - 44 / - col1 AS col1 FROM tab0 GROUP BY col2, col2, col1 HAVING NULL < + + col2
----

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING - 33 = + col2
----


query I rowsort
SELECT - COALESCE ( - 72, - + col0 * - - col2 + - + col1 ) FROM tab1 GROUP BY col1
----
72
72
72

................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7733
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL BETWEEN ( - col1 / CAST( col2 AS SIGNED ) ) AND ( 13 )
----

skipif mysql # not compatible

query I rowsort label-7733
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL BETWEEN ( - col1 / CAST ( col2 AS INTEGER ) ) AND ( 13 )
----


query I rowsort
SELECT - COALESCE ( + 0, col1 ) FROM tab1 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT 66 FROM tab2 GROUP BY col2
----
................................................................................
NULL
22
NULL
28
NULL
82


query I rowsort
SELECT COALESCE ( 89, + col2 ) FROM tab0 cor0 GROUP BY col1
----
89
89

query I rowsort
................................................................................
-3364
-3364
-6241
-6241
-7569
-7569


query II rowsort
SELECT 36 * + + 81 col1, + col2 FROM tab1 GROUP BY col2
----
2916
45
2916
71
................................................................................

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query II rowsort label-8045
SELECT - + 63 + - 36 AS col2, + NULLIF ( - CAST( NULL AS SIGNED ), + col2 ) + - + col0 / - 32 / + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + CAST( NULL AS DECIMAL ) > ( - + 7 )
----

skipif mysql # not compatible

query II rowsort label-8045
SELECT - + 63 + - 36 AS col2, + NULLIF ( - CAST ( NULL AS INTEGER ), + col2 ) + - + col0 / - 32 / + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + CAST ( NULL AS REAL ) > ( - + 7 )
----

query I rowsort
SELECT 91 FROM tab2 GROUP BY col2
----
................................................................................
SELECT ALL - col1 AS col1 FROM tab1 AS cor0 WHERE NOT ( - col1 + + col2 ) NOT BETWEEN + col0 AND + col2 GROUP BY col2, col1
----

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


query I rowsort
SELECT ALL + 53 * + 8 + col1 * + 13 - - COALESCE ( + 83, - col0, - col1 * + 59 ) AS col2 FROM tab0 GROUP BY col1, col1, col1 HAVING NOT NULL IS NOT NULL
----
1560
507

query I rowsort
................................................................................
SELECT ALL + ( + ( + COALESCE ( CAST( + 0 AS SIGNED ), + col1 ) ) ) - - 96 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
96
96
96

skipif mysql # not compatible

query I rowsort label-8061
SELECT ALL + ( + ( + COALESCE ( CAST ( + 0 AS INTEGER ), + col1 ) ) ) - - 96 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
96
96
96

................................................................................
query I rowsort
SELECT - ( 86 ) FROM tab0 GROUP BY col2, col1
----
-86
-86
-86


query II rowsort
SELECT ALL + col1 col2, + 14 AS col0 FROM tab0 AS cor0 WHERE NOT ( NOT + col2 IS NULL ) GROUP BY col1 HAVING NOT 59 IS NULL
----

query I rowsort
SELECT 69 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
................................................................................
-4203
91
-4250
92
-631
15


query I rowsort
SELECT ALL - 72 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING - 49 NOT BETWEEN ( - 46 ) AND - + 47 + - + col2
----
-72
-72
-72

................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query III rowsort label-8342
SELECT ALL - + col0 col1, - col0 * - col0 * - col0 AS col1, + - 81 - 18 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING + CAST( + + 36 AS SIGNED ) IS NULL
----

skipif mysql # not compatible

query III rowsort label-8342
SELECT ALL - + col0 col1, - col0 * - col0 * - col0 AS col1, + - 81 - 18 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING + CAST ( + + 36 AS INTEGER ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8343
SELECT - + col1 DIV + col1 + col1 col0 FROM tab2 AS cor0 GROUP BY col1
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8387
SELECT ALL col0, - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL = col0 + + col1 / + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible

query II rowsort label-8387
SELECT ALL col0, - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL = col0 + + col1 / + CAST ( NULL AS INTEGER )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8388
SELECT ALL - col0 + col0 AS col1, CAST( + 32 AS SIGNED ) col2 FROM tab1 cor0 GROUP BY col0
................................................................................
NULL
NULL

query I rowsort
SELECT NULLIF ( - 6, + + col0 ) AS col2 FROM tab2 AS cor0 WHERE 41 IS NULL GROUP BY col2, col0
----


query II rowsort
SELECT + col0, col0 / - col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT - ( col2 ) AS col2 FROM tab2 AS cor0 GROUP BY col2
----
................................................................................
query I rowsort
SELECT - 36 + + 65 FROM tab0 AS cor0 GROUP BY col0
----
29
29
29


query I rowsort
SELECT + + 82 + - col1 + + - 6 - COALESCE ( + 79, 34 + - col2 ) AS col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
-44
-62
-64

................................................................................
SELECT DISTINCT + col2 * + + CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 - + 53 / + 34 FROM tab1 WHERE NULL IS NULL GROUP BY col1 HAVING + 8 = NULL
----


query II rowsort
SELECT col2 col2, 46 + + col2 + + + col2 AS col0 FROM tab1 GROUP BY col2, col2
----
45
136
71
188
................................................................................
query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col0, col2 HAVING NULL IS NULL
----
26
43
83


query I rowsort
SELECT + CASE - - 56 WHEN + 25 THEN + - col2 * + + 18 * + 96 + - ( + + 15 ) * col2 - + col2 * - col0 + + col0 END FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

................................................................................

query I rowsort
SELECT DISTINCT col1 + 83 FROM tab0 AS cor0 GROUP BY col1
----
164
83


query II rowsort
SELECT ALL + col1 col1, - 69 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( - 79 ) = ( NULL )
----

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


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

query I rowsort
SELECT - ( - + col2 ) AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8761
SELECT CAST( NULL AS SIGNED ) AS col2 FROM tab0 GROUP BY col1 HAVING NOT ( col2 <= NULL )
----

skipif mysql # not compatible

query I rowsort label-8761
SELECT CAST ( NULL AS INTEGER ) AS col2 FROM tab0 GROUP BY col1 HAVING NOT ( col2 <= NULL )
----


query I rowsort
SELECT + CASE WHEN NOT NULL NOT BETWEEN NULL AND NULL THEN - col1 ELSE NULL END FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8764
SELECT DISTINCT - 9 + COALESCE ( + - 50, col1, col0 * CAST( NULL AS SIGNED ) ) FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
-59

skipif mysql # not compatible

query I rowsort label-8764
SELECT DISTINCT - 9 + COALESCE ( + - 50, col1, col0 * CAST ( NULL AS INTEGER ) ) FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
-59

query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col2 HAVING - + col2 BETWEEN ( NULL ) AND NULL
................................................................................
-22
22
-28
28
-82
82


query II rowsort
SELECT ALL ( + col1 ) AS col0, col1 AS col2 FROM tab0 AS cor0 WHERE NOT ( + ( + col0 ) ) IS NULL GROUP BY col1 HAVING ( NOT col2 * + 27 * + - 3 <> NULL )
----

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


query I rowsort
SELECT + col0 * COALESCE ( 0, 77 * NULLIF ( + col0, - col0 ) + - 30, + col0, col1 * + 49 ) FROM tab1 WHERE NOT 27 * + - col1 IS NULL GROUP BY col0, col0 HAVING NOT + 81 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - 44 AS col2 FROM tab1 WHERE NULL < NULL GROUP BY col1, col0
----
................................................................................

skipif mysql # not compatible
query I rowsort label-8919
SELECT DISTINCT + 73 / 85 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL OR NOT NULL = NULL
----
0


query II rowsort
SELECT col0 col2, col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
26
26
43
43
................................................................................
query I rowsort
SELECT ALL - col1 FROM tab1 GROUP BY col1, col1, col2
----
-44
-57
-6


query II rowsort
SELECT DISTINCT + 68 col2, + col0 FROM tab0 AS cor0 GROUP BY col0
----
68
26
68
43
................................................................................
NULL
43
NULL
84
NULL

skipif mysql # not compatible

query II rowsort label-8953
SELECT DISTINCT + col2 + 5 + + col1 col0, 50 - - 34 * ( + CAST ( NULL AS INTEGER ) ) AS col1 FROM tab0 GROUP BY col2, col1
----
110
NULL
43
NULL
................................................................................
query I rowsort
SELECT ALL 38 * + col1 + + + 6 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
1564
2248
2324


query II rowsort
SELECT ALL - col1 col0, col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
81
0
0
................................................................................
query I rowsort
SELECT - 98 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING - col2 <= + 36
----
-98
-98
-98


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

query I rowsort
SELECT col0 - col2 * + 71 FROM tab1 GROUP BY col2, col0 HAVING NOT - col0 > NULL
----
................................................................................
-2

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


query II rowsort
SELECT ALL col2 col0, 12 AS col1 FROM tab2 AS cor0 WHERE - col0 < NULL GROUP BY col2 HAVING NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9155
SELECT ALL CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col0
................................................................................
-83
-83

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


query I rowsort
SELECT ALL - COALESCE ( - + 18, + - 49, + - col2 + - col2 * 99 ) * 70 FROM tab1 GROUP BY col0 HAVING + 33 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( + 72 ) + - col1 col2 FROM tab0 GROUP BY col1
................................................................................
query I rowsort
SELECT + 81 FROM tab0 GROUP BY col0
----
81
81
81


query I rowsort
SELECT + - COALESCE ( - ( + 3 ), col0 ) - col1 * NULLIF ( col1, col1 - 24 ) AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL <> ( NULL )
----

query I rowsort
SELECT ALL 37 AS col1 FROM tab0 GROUP BY col1, col2
----
................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9278
SELECT DISTINCT - - CASE WHEN NOT ( NULL ) BETWEEN ( + + 21 ) AND 42 * - CASE - col1 WHEN - col1 * - 20 * - col1 + - 83 THEN NULL ELSE - COALESCE ( CAST( NULL AS SIGNED ), + + 58 + 99 ) * + col1 END THEN + - 84 END AS col2 FROM tab1 cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible

query I rowsort label-9278
SELECT DISTINCT - - CASE WHEN NOT ( NULL ) BETWEEN ( + + 21 ) AND 42 * - CASE - col1 WHEN - col1 * - 20 * - col1 + - 83 THEN NULL ELSE - COALESCE ( CAST ( NULL AS INTEGER ), + + 58 + 99 ) * + col1 END THEN + - 84 END AS col2 FROM tab1 cor0 GROUP BY col0
----
NULL

query I rowsort
SELECT + 2 * + - col1 + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
................................................................................

query I rowsort
SELECT ALL + + 87 - 12 FROM tab0 AS cor0 GROUP BY col1
----
75
75


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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 AS col0, + col0 * + 49 - col0 + + ( col0 ) * - col0 + - col0 col1 FROM tab2 AS cor0 GROUP BY col0
................................................................................
-5156
-78

query I rowsort
SELECT ALL - 22 + + col0 FROM tab2 AS cor0 WHERE + col0 * col0 IS NOT NULL GROUP BY col0 HAVING NOT NULL NOT IN ( col0 )
----


query I rowsort
SELECT - col1 * + - COALESCE ( + 48, + COALESCE ( 27, col2 ) ) + - 76 * ( - col1 + + col1 * col1 ) FROM tab1 AS cor0 GROUP BY col1
----
-141680
-1992
-239856

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


query I rowsort
SELECT - COALESCE ( + 4, + + col0 * 32 ) FROM tab2 AS cor0 GROUP BY col2
----
-4
-4
-4

................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9346
SELECT CAST( NULL AS SIGNED ) + col2 col1, - col2 - - + COALESCE ( 3, + NULLIF ( 47, + 66 / col0 ), - 79 ) AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT + CAST( + ( + 90 ) AS SIGNED ) >= ( NULL )
----

skipif mysql # not compatible

query II rowsort label-9346
SELECT CAST ( NULL AS INTEGER ) + col2 col1, - col2 - - + COALESCE ( 3, + NULLIF ( 47, + 66 / col0 ), - 79 ) AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT + CAST ( + ( + 90 ) AS INTEGER ) >= ( NULL )
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT ( ( NULL IS NULL ) )
----
................................................................................
SELECT col0 - - + 61 DIV - - COALESCE ( - 35, + 83, - col2 ) FROM tab0 AS cor0 GROUP BY col0
----
25
42
82

skipif mysql # not compatible

query I rowsort label-9356
SELECT col0 - - + 61 / - - COALESCE ( - 35, + 83, - col2 ) FROM tab0 AS cor0 GROUP BY col0
----
25
42
82

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


query I rowsort
SELECT - - col0 + - ( + col0 ) + + - CASE WHEN ( + col0 ) < ( NULL ) THEN - col2 END + 97 / col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL NOT IN ( - col0 * + col0 )
----

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


query II rowsort
SELECT DISTINCT - col0 col0, 90 + 62 + 53 + - + col0 * - col0 AS col2 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col1, col2, col1
----
................................................................................
query I rowsort
SELECT - 34 + - 62 FROM tab0 WHERE - + col1 IS NOT NULL GROUP BY col2, col1
----
-96
-96
-96


query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING COALESCE ( COALESCE ( + 24, col0 ), - - NULLIF ( - col1, + col2 ) * 51 + CASE + col0 - - 79 * col1 WHEN + ( - col2 ) THEN NULL ELSE - 5 * col2 END ) > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9551
SELECT + 0 / col2 + + + ( CAST( NULL AS SIGNED ) ) * + col2 + - col2 FROM tab2 cor0 GROUP BY col2, col2
................................................................................
----

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


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

query II rowsort
SELECT col0 * + + col0 AS col1, - col1 + col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0, col1
----
................................................................................
query I rowsort label-9663
SELECT 41 + 71 - + + 40 * CAST ( NULL AS REAL ) FROM tab2 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL


query II rowsort
SELECT - 2 col1, col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT - 46 IS NULL
----
-2
15
-2
91
................................................................................
onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query III rowsort label-9684
SELECT col0 DIV - - 41 * - col0 col1, + col0 * + col0, - 3 * + CAST( NULL AS SIGNED ) AS col1 FROM tab2 cor0 GROUP BY col0
----
9 values hashing to 28d1a296c6990b10de76d21db8c99739

skipif mysql # not compatible

query III rowsort label-9684
SELECT col0 / - - 41 * - col0 col1, + col0 * + col0, - 3 * + CAST ( NULL AS INTEGER ) AS col1 FROM tab2 cor0 GROUP BY col0
----
9 values hashing to 28d1a296c6990b10de76d21db8c99739

query I rowsort
SELECT + 66 + - col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL <= - col1
................................................................................
-819
-828

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


query II rowsort
SELECT - col0 col1, + col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
-15
15
-91
91
................................................................................
SELECT DISTINCT col0 + - 25 + + - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

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


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

query I rowsort
SELECT - 46 * + col1 FROM tab2 GROUP BY col1
----
................................................................................
0
81

query I rowsort
SELECT ALL - AVG ( DISTINCT 81 ) AS col2 FROM tab2 cor0 WHERE NOT - col2 * col2 <= + 17 GROUP BY col1 HAVING NOT - ( col1 ) IS NOT NULL
----


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

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

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9925
SELECT + 45 * + CAST( 44 AS SIGNED ) * + COALESCE ( 13, - col1 ) + col2 FROM tab0 GROUP BY col2, col0, col2 HAVING ( - 39 + + col0 ) IS NULL
----

skipif mysql # not compatible

query I rowsort label-9925
SELECT + 45 * + CAST ( 44 AS INTEGER ) * + COALESCE ( 13, - col1 ) + col2 FROM tab0 GROUP BY col2, col0, col2 HAVING ( - 39 + + col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT - col0 + + col1 * + col1 AS col1 FROM tab1 GROUP BY col1, col0
----
................................................................................
91
92

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


query II rowsort
SELECT col1, + col1 + 43 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL BETWEEN ( col0 ) AND - + 68 * + + 41 - - 84 + + - col1
----

query I rowsort
SELECT DISTINCT 24 AS col0 FROM tab0 GROUP BY col0
----
................................................................................
137
43
56
26
56
83


query II rowsort
SELECT DISTINCT col0 col2, 96 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( col0 ) NOT BETWEEN - 73 AND NULL
----

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







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>











>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>










>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>













>







 







>







 







>







 







>










>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>




>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>




>







 







>







 







>











>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>











>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
....
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
....
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
....
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
....
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
....
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
....
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
....
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
....
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
....
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
....
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
....
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
....
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
....
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
....
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
....
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
....
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
....
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
.....
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
.....
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
.....
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
.....
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
.....
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
.....
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
.....
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
.....
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
.....
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
.....
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
.....
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
.....
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
.....
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
.....
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
.....
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
.....
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
.....
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
.....
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
.....
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
.....
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
.....
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
.....
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
.....
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
.....
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
.....
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
.....
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
.....
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
.....
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
.....
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
.....
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
.....
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
.....
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
.....
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
.....
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
.....
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
.....
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
.....
21718
21719
21720
21721
21722
21723
21724
21725
21726
21727
21728
21729
21730
21731
21732
.....
22071
22072
22073
22074
22075
22076
22077
22078
22079
22080
22081
22082
22083
22084
22085
.....
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316
22317
22318
22319
22320
.....
22538
22539
22540
22541
22542
22543
22544
22545
22546
22547
22548
22549
22550
22551
22552
.....
22783
22784
22785
22786
22787
22788
22789
22790
22791
22792
22793
22794
22795
22796
22797
.....
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
.....
23525
23526
23527
23528
23529
23530
23531
23532
23533
23534
23535
23536
23537
23538
23539
.....
23859
23860
23861
23862
23863
23864
23865
23866
23867
23868
23869
23870
23871
23872
23873
.....
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011
.....
24437
24438
24439
24440
24441
24442
24443
24444
24445
24446
24447
24448
24449
24450
24451
.....
24795
24796
24797
24798
24799
24800
24801
24802
24803
24804
24805
24806
24807
24808
24809
.....
24836
24837
24838
24839
24840
24841
24842
24843
24844
24845
24846
24847
24848
24849
24850
.....
24913
24914
24915
24916
24917
24918
24919
24920
24921
24922
24923
24924
24925
24926
24927
.....
25625
25626
25627
25628
25629
25630
25631
25632
25633
25634
25635
25636
25637
25638
25639
.....
26046
26047
26048
26049
26050
26051
26052
26053
26054
26055
26056
26057
26058
26059
26060
.....
26300
26301
26302
26303
26304
26305
26306
26307
26308
26309
26310
26311
26312
26313
26314
.....
26560
26561
26562
26563
26564
26565
26566
26567
26568
26569
26570
26571
26572
26573
26574
.....
26820
26821
26822
26823
26824
26825
26826
26827
26828
26829
26830
26831
26832
26833
26834
.....
27403
27404
27405
27406
27407
27408
27409
27410
27411
27412
27413
27414
27415
27416
27417
.....
28555
28556
28557
28558
28559
28560
28561
28562
28563
28564
28565
28566
28567
28568
28569
.....
28676
28677
28678
28679
28680
28681
28682
28683
28684
28685
28686
28687
28688
28689
28690
.....
28759
28760
28761
28762
28763
28764
28765
28766
28767
28768
28769
28770
28771
28772
28773
.....
28903
28904
28905
28906
28907
28908
28909
28910
28911
28912
28913
28914
28915
28916
28917
.....
30139
30140
30141
30142
30143
30144
30145
30146
30147
30148
30149
30150
30151
30152
30153
.....
30578
30579
30580
30581
30582
30583
30584
30585
30586
30587
30588
30589
30590
30591
30592
.....
30774
30775
30776
30777
30778
30779
30780
30781
30782
30783
30784
30785
30786
30787
30788
.....
31112
31113
31114
31115
31116
31117
31118
31119
31120
31121
31122
31123
31124
31125
31126
.....
31190
31191
31192
31193
31194
31195
31196
31197
31198
31199
31200
31201
31202
31203
31204
.....
31284
31285
31286
31287
31288
31289
31290
31291
31292
31293
31294
31295
31296
31297
31298
.....
31332
31333
31334
31335
31336
31337
31338
31339
31340
31341
31342
31343
31344
31345
31346
.....
31413
31414
31415
31416
31417
31418
31419
31420
31421
31422
31423
31424
31425
31426
31427
.....
31909
31910
31911
31912
31913
31914
31915
31916
31917
31918
31919
31920
31921
31922
31923
.....
32022
32023
32024
32025
32026
32027
32028
32029
32030
32031
32032
32033
32034
32035
32036
.....
32099
32100
32101
32102
32103
32104
32105
32106
32107
32108
32109
32110
32111
32112
32113
.....
32146
32147
32148
32149
32150
32151
32152
32153
32154
32155
32156
32157
32158
32159
32160
.....
32253
32254
32255
32256
32257
32258
32259
32260
32261
32262
32263
32264
32265
32266
32267
.....
33081
33082
33083
33084
33085
33086
33087
33088
33089
33090
33091
33092
33093
33094
33095
.....
33456
33457
33458
33459
33460
33461
33462
33463
33464
33465
33466
33467
33468
33469
33470
.....
33605
33606
33607
33608
33609
33610
33611
33612
33613
33614
33615
33616
33617
33618
33619
.....
33668
33669
33670
33671
33672
33673
33674
33675
33676
33677
33678
33679
33680
33681
33682
.....
33807
33808
33809
33810
33811
33812
33813
33814
33815
33816
33817
33818
33819
33820
33821
.....
33844
33845
33846
33847
33848
33849
33850
33851
33852
33853
33854
33855
33856
33857
33858
.....
34185
34186
34187
34188
34189
34190
34191
34192
34193
34194
34195
34196
34197
34198
34199
.....
34255
34256
34257
34258
34259
34260
34261
34262
34263
34264
34265
34266
34267
34268
34269
.....
34562
34563
34564
34565
34566
34567
34568
34569
34570
34571
34572
34573
34574
34575
34576
.....
34849
34850
34851
34852
34853
34854
34855
34856
34857
34858
34859
34860
34861
34862
34863
34864
34865
34866
34867
34868
34869
34870
34871
34872
34873
34874
.....
35040
35041
35042
35043
35044
35045
35046
35047
35048
35049
35050
35051
35052
35053
35054
.....
35844
35845
35846
35847
35848
35849
35850
35851
35852
35853
35854
35855
35856
35857
35858
.....
35921
35922
35923
35924
35925
35926
35927
35928
35929
35930
35931
35932
35933
35934
35935
.....
36508
36509
36510
36511
36512
36513
36514
36515
36516
36517
36518
36519
36520
36521
36522
.....
36601
36602
36603
36604
36605
36606
36607
36608
36609
36610
36611
36612
36613
36614
36615
.....
36706
36707
36708
36709
36710
36711
36712
36713
36714
36715
36716
36717
36718
36719
36720
.....
37670
37671
37672
37673
37674
37675
37676
37677
37678
37679
37680
37681
37682
37683
37684
.....
38036
38037
38038
38039
38040
38041
38042
38043
38044
38045
38046
38047
38048
38049
38050
.....
38444
38445
38446
38447
38448
38449
38450
38451
38452
38453
38454
38455
38456
38457
38458
.....
38472
38473
38474
38475
38476
38477
38478
38479
38480
38481
38482
38483
38484
38485
38486
.....
38966
38967
38968
38969
38970
38971
38972
38973
38974
38975
38976
38977
38978
38979
38980
.....
39195
39196
39197
39198
39199
39200
39201
39202
39203
39204
39205
39206
39207
39208
39209
.....
39491
39492
39493
39494
39495
39496
39497
39498
39499
39500
39501
39502
39503
39504
39505
.....
39526
39527
39528
39529
39530
39531
39532
39533
39534
39535
39536
39537
39538
39539
39540
.....
39591
39592
39593
39594
39595
39596
39597
39598
39599
39600
39601
39602
39603
39604
39605
.....
39804
39805
39806
39807
39808
39809
39810
39811
39812
39813
39814
39815
39816
39817
39818
.....
40070
40071
40072
40073
40074
40075
40076
40077
40078
40079
40080
40081
40082
40083
40084
.....
40271
40272
40273
40274
40275
40276
40277
40278
40279
40280
40281
40282
40283
40284
40285
.....
40801
40802
40803
40804
40805
40806
40807
40808
40809
40810
40811
40812
40813
40814
40815
.....
41015
41016
41017
41018
41019
41020
41021
41022
41023
41024
41025
41026
41027
41028
41029
.....
42053
42054
42055
42056
42057
42058
42059
42060
42061
42062
42063
42064
42065
42066
42067
.....
42266
42267
42268
42269
42270
42271
42272
42273
42274
42275
42276
42277
42278
42279
42280
.....
42281
42282
42283
42284
42285
42286
42287
42288
42289
42290
42291
42292
42293
42294
42295
.....
42455
42456
42457
42458
42459
42460
42461
42462
42463
42464
42465
42466
42467
42468
42469
.....
42480
42481
42482
42483
42484
42485
42486
42487
42488
42489
42490
42491
42492
42493
42494
.....
42663
42664
42665
42666
42667
42668
42669
42670
42671
42672
42673
42674
42675
42676
42677
.....
42905
42906
42907
42908
42909
42910
42911
42912
42913
42914
42915
42916
42917
42918
42919
.....
43050
43051
43052
43053
43054
43055
43056
43057
43058
43059
43060
43061
43062
43063
43064
.....
43118
43119
43120
43121
43122
43123
43124
43125
43126
43127
43128
43129
43130
43131
43132
.....
43302
43303
43304
43305
43306
43307
43308
43309
43310
43311
43312
43313
43314
43315
43316
.....
43412
43413
43414
43415
43416
43417
43418
43419
43420
43421
43422
43423
43424
43425
43426
.....
43624
43625
43626
43627
43628
43629
43630
43631
43632
43633
43634
43635
43636
43637
43638
.....
44097
44098
44099
44100
44101
44102
44103
44104
44105
44106
44107
44108
44109
44110
44111
.....
44553
44554
44555
44556
44557
44558
44559
44560
44561
44562
44563
44564
44565
44566
44567
.....
44604
44605
44606
44607
44608
44609
44610
44611
44612
44613
44614
44615
44616
44617
44618
.....
45134
45135
45136
45137
45138
45139
45140
45141
45142
45143
45144
45145
45146
45147
45148
.....
45180
45181
45182
45183
45184
45185
45186
45187
45188
45189
45190
45191
45192
45193
45194
.....
45572
45573
45574
45575
45576
45577
45578
45579
45580
45581
45582
45583
45584
45585
45586
.....
45607
45608
45609
45610
45611
45612
45613
45614
45615
45616
45617
45618
45619
45620
45621
.....
46351
46352
46353
46354
46355
46356
46357
46358
46359
46360
46361
46362
46363
46364
46365
.....
46575
46576
46577
46578
46579
46580
46581
46582
46583
46584
46585
46586
46587
46588
46589
.....
46822
46823
46824
46825
46826
46827
46828
46829
46830
46831
46832
46833
46834
46835
46836
.....
46934
46935
46936
46937
46938
46939
46940
46941
46942
46943
46944
46945
46946
46947
46948
.....
47019
47020
47021
47022
47023
47024
47025
47026
47027
47028
47029
47030
47031
47032
47033
.....
47978
47979
47980
47981
47982
47983
47984
47985
47986
47987
47988
47989
47990
47991
47992
.....
48138
48139
48140
48141
48142
48143
48144
48145
48146
48147
48148
48149
48150
48151
48152
.....
48201
48202
48203
48204
48205
48206
48207
48208
48209
48210
48211
48212
48213
48214
48215
.....
48235
48236
48237
48238
48239
48240
48241
48242
48243
48244
48245
48246
48247
48248
48249
.....
48849
48850
48851
48852
48853
48854
48855
48856
48857
48858
48859
48860
48861
48862
48863
.....
49009
49010
49011
49012
49013
49014
49015
49016
49017
49018
49019
49020
49021
49022
49023
.....
49331
49332
49333
49334
49335
49336
49337
49338
49339
49340
49341
49342
49343
49344
49345
.....
49527
49528
49529
49530
49531
49532
49533
49534
49535
49536
49537
49538
49539
49540
49541
.....
49694
49695
49696
49697
49698
49699
49700
49701
49702
49703
49704
49705
49706
49707
49708
.....
50999
51000
51001
51002
51003
51004
51005
51006
51007
51008
51009
51010
51011
51012
51013
.....
51289
51290
51291
51292
51293
51294
51295
51296
51297
51298
51299
51300
51301
51302
51303
.....
51465
51466
51467
51468
51469
51470
51471
51472
51473
51474
51475
51476
51477
51478
51479
.....
51775
51776
51777
51778
51779
51780
51781
51782
51783
51784
51785
51786
51787
51788
51789
.....
51843
51844
51845
51846
51847
51848
51849
51850
51851
51852
51853
51854
51855
51856
51857
.....
51916
51917
51918
51919
51920
51921
51922
51923
51924
51925
51926
51927
51928
51929
51930
51931
51932
51933
51934
51935
51936
51937
51938
51939
51940
51941
51942
51943
51944
.....
52096
52097
52098
52099
52100
52101
52102
52103
52104
52105
52106
52107
52108
52109
52110
.....
52290
52291
52292
52293
52294
52295
52296
52297
52298
52299
52300
52301
52302
52303
52304
.....
52639
52640
52641
52642
52643
52644
52645
52646
52647
52648
52649
52650
52651
52652
52653
52654
52655
52656
52657
52658
52659
52660
52661
52662
52663
52664
.....
52839
52840
52841
52842
52843
52844
52845
52846
52847
52848
52849
52850
52851
52852
52853
.....
53010
53011
53012
53013
53014
53015
53016
53017
53018
53019
53020
53021
53022
53023
53024
.....
53223
53224
53225
53226
53227
53228
53229
53230
53231
53232
53233
53234
53235
53236
53237
.....
53368
53369
53370
53371
53372
53373
53374
53375
53376
53377
53378
53379
53380
53381
53382
.....
53674
53675
53676
53677
53678
53679
53680
53681
53682
53683
53684
53685
53686
53687
53688
.....
54029
54030
54031
54032
54033
54034
54035
54036
54037
54038
54039
54040
54041
54042
54043
.....
54062
54063
54064
54065
54066
54067
54068
54069
54070
54071
54072
54073
54074
54075
54076
.....
54237
54238
54239
54240
54241
54242
54243
54244
54245
54246
54247
54248
54249
54250
54251
54252
54253
54254
54255
54256
.....
54475
54476
54477
54478
54479
54480
54481
54482
54483
54484
54485
54486
54487
54488
54489
.....
55786
55787
55788
55789
55790
55791
55792
55793
55794
55795
55796
55797
55798
55799
55800
.....
56491
56492
56493
56494
56495
56496
56497
56498
56499
56500
56501
56502
56503
56504
56505
.....
56563
56564
56565
56566
56567
56568
56569
56570
56571
56572
56573
56574
56575
56576
56577
.....
56603
56604
56605
56606
56607
56608
56609
56610
56611
56612
56613
56614
56615
56616
56617
.....
56907
56908
56909
56910
56911
56912
56913
56914
56915
56916
56917
56918
56919
56920
56921
.....
58293
58294
58295
58296
58297
58298
58299
58300
58301
58302
58303
58304
58305
58306
58307
.....
58665
58666
58667
58668
58669
58670
58671
58672
58673
58674
58675
58676
58677
58678
58679
.....
59020
59021
59022
59023
59024
59025
59026
59027
59028
59029
59030
59031
59032
59033
59034
.....
59471
59472
59473
59474
59475
59476
59477
59478
59479
59480
59481
59482
59483
59484
59485
.....
59606
59607
59608
59609
59610
59611
59612
59613
59614
59615
59616
59617
59618
59619
59620
.....
59649
59650
59651
59652
59653
59654
59655
59656
59657
59658
59659
59660
59661
59662
59663
.....
59751
59752
59753
59754
59755
59756
59757
59758
59759
59760
59761
59762
59763
59764
59765
.....
60054
60055
60056
60057
60058
60059
60060
60061
60062
60063
60064
60065
60066
60067
60068
.....
61852
61853
61854
61855
61856
61857
61858
61859
61860
61861
61862
61863
61864
61865
61866
.....
61899
61900
61901
61902
61903
61904
61905
61906
61907
61908
61909
61910
61911
61912
61913
61914
61915
61916
61917
61918
.....
61925
61926
61927
61928
61929
61930
61931
61932
61933
61934
61935
61936
61937
61938
61939
.....
62473
62474
62475
62476
62477
62478
62479
62480
62481
62482
62483
62484
62485
62486
62487
62488
62489
62490
62491
62492
62493
62494
62495
62496
62497
62498
62499
.....
63018
63019
63020
63021
63022
63023
63024
63025
63026
63027
63028
63029
63030
63031
63032
.....
63115
63116
63117
63118
63119
63120
63121
63122
63123
63124
63125
63126
63127
63128
63129
.....
63268
63269
63270
63271
63272
63273
63274
63275
63276
63277
63278
63279
63280
63281
63282
.....
64055
64056
64057
64058
64059
64060
64061
64062
64063
64064
64065
64066
64067
64068
64069
.....
64611
64612
64613
64614
64615
64616
64617
64618
64619
64620
64621
64622
64623
64624
64625
.....
64680
64681
64682
64683
64684
64685
64686
64687
64688
64689
64690
64691
64692
64693
64694
.....
65328
65329
65330
65331
65332
65333
65334
65335
65336
65337
65338
65339
65340
65341
65342
.....
65362
65363
65364
65365
65366
65367
65368
65369
65370
65371
65372
65373
65374
65375
65376
.....
65631
65632
65633
65634
65635
65636
65637
65638
65639
65640
65641
65642
65643
65644
65645
.....
65777
65778
65779
65780
65781
65782
65783
65784
65785
65786
65787
65788
65789
65790
65791
.....
65980
65981
65982
65983
65984
65985
65986
65987
65988
65989
65990
65991
65992
65993
65994
.....
66054
66055
66056
66057
66058
66059
66060
66061
66062
66063
66064
66065
66066
66067
66068
.....
66102
66103
66104
66105
66106
66107
66108
66109
66110
66111
66112
66113
66114
66115
66116
.....
66194
66195
66196
66197
66198
66199
66200
66201
66202
66203
66204
66205
66206
66207
66208
.....
67581
67582
67583
67584
67585
67586
67587
67588
67589
67590
67591
67592
67593
67594
67595
67596
67597
67598
67599
67600
67601
67602
67603
67604
67605
67606
67607
.....
67634
67635
67636
67637
67638
67639
67640
67641
67642
67643
67644
67645
67646
67647
67648
.....
68476
68477
68478
68479
68480
68481
68482
68483
68484
68485
68486
68487
68488
68489
68490
.....
68536
68537
68538
68539
68540
68541
68542
68543
68544
68545
68546
68547
68548
68549
68550
.....
68658
68659
68660
68661
68662
68663
68664
68665
68666
68667
68668
68669
68670
68671
68672
.....
69839
69840
69841
69842
69843
69844
69845
69846
69847
69848
69849
69850
69851
69852
69853
.....
69922
69923
69924
69925
69926
69927
69928
69929
69930
69931
69932
69933
69934
69935
69936
.....
69989
69990
69991
69992
69993
69994
69995
69996
69997
69998
69999
70000
70001
70002
70003
.....
70401
70402
70403
70404
70405
70406
70407
70408
70409
70410
70411
70412
70413
70414
70415
.....
70540
70541
70542
70543
70544
70545
70546
70547
70548
70549
70550
70551
70552
70553
70554
.....
70901
70902
70903
70904
70905
70906
70907
70908
70909
70910
70911
70912
70913
70914
70915
query I rowsort
SELECT DISTINCT col2 * - col2 AS col1 FROM tab1 GROUP BY col1, col2
----
-2025
-5041
-64

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

query I rowsort
SELECT DISTINCT - col0 * - col0 * col0 FROM tab2 GROUP BY col0
----
................................................................................
38
79

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

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

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

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

query I rowsort
SELECT col0 / - col0 AS col2 FROM tab1 GROUP BY col0, col1 HAVING NULL IS NOT NULL
----
................................................................................
query I rowsort
SELECT ALL - col0 + - col0 FROM tab1 GROUP BY col0
----
-164
-44
-56

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

query I rowsort
SELECT ALL - + col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
................................................................................
query I rowsort
SELECT DISTINCT col0 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NULL
----
26
43
83

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

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

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

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

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

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

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

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT col2, AVG ( ALL - col2 ) * - - col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NOT NULL <= col1
----

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

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

query I rowsort
SELECT ALL col1 * - + col1 AS col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) >= NULL GROUP BY col1
----
................................................................................
-8
8

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col2, col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
24
24
38
38
................................................................................
SELECT DISTINCT col1 + col1 col0 FROM tab1 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col2
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 col0, - col0 AS col0 FROM tab2 GROUP BY col0
----
-15
-15
-91
-91
................................................................................
query I rowsort
SELECT DISTINCT - col1 AS col2 FROM tab1 AS cor0 GROUP BY col1, col2 HAVING - + col2 IS NOT NULL
----
-44
-57
-6

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

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

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( NULL ) <= - col0 - - col0
----

query I rowsort
SELECT DISTINCT - col1 * - col1 FROM tab2 AS cor0 GROUP BY col1
----
................................................................................
16
90

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1 col2, + col1 AS col2 FROM tab1 cor0 GROUP BY col1, col1 HAVING NOT ( NULL ) IS NOT NULL
----
44
44
57
57
................................................................................
8281
8464

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

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

query I rowsort
SELECT ALL - + col2 + - + col0 AS col2 FROM tab0 cor0 GROUP BY col0, col2
----
................................................................................
59
61

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

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

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

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

query I rowsort
SELECT - - col0 * + + col0 FROM tab2 AS cor0 GROUP BY col2, col0
----
................................................................................
-210
30
-8190
182
-8372
184

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col0, col1 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
41
41
59
59
................................................................................
query I rowsort label-2148
SELECT col1 / - col1 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT + col0 AS col2, + col1 FROM tab1 GROUP BY col0, col1 HAVING NOT ( NULL ) < col1 + col2
----

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - - col1 col2, col0 FROM tab1 AS cor0 GROUP BY col1, col0
----
44
82
57
28
................................................................................
query I rowsort
SELECT col1 + col1 AS col0 FROM tab1 AS cor0 GROUP BY col1
----
114
12
88

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

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

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

query I rowsort
SELECT DISTINCT - + col2 * + - col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
----
................................................................................
query I rowsort
SELECT ALL - - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
45
71
8

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + + col0 col0, col0 FROM tab1 AS cor0 GROUP BY col0
----
22
22
28
28
................................................................................
query I rowsort
SELECT col0 * + - col0 * col0 FROM tab2 AS cor0 GROUP BY col0, col0
----
-3375
-753571
-778688

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

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col2, + col2 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
24
24
38
38
................................................................................
query I rowsort
SELECT ALL col2 AS col2 FROM tab1 GROUP BY col2 HAVING NOT ( NULL IS NOT NULL )
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 - - + col1 col2, - col2 FROM tab0 AS cor0 GROUP BY col1, col2
----
105
-24
38
-38
................................................................................
-650
-6806

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT col2 col1 FROM tab1 GROUP BY col2, col1
................................................................................
184
30

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

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

query I rowsort
SELECT - col0 FROM tab2 GROUP BY col0 HAVING NOT NULL BETWEEN col0 AND NULL
----
................................................................................
query I rowsort
SELECT ALL - col2 * - col2 FROM tab1 GROUP BY col2
----
2025
5041
64

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 / - col1 AS col2 FROM tab0 AS cor0 WHERE col0 IS NULL GROUP BY col1 HAVING ( col2 ) IS NULL OR NOT NULL IS NOT NULL
----

query II rowsort
SELECT DISTINCT + + col2, + col2 + - 75 AS col0 FROM tab1 cor0 GROUP BY col2, col2 HAVING - col2 + - 17 IS NULL
----
................................................................................
query I rowsort
SELECT ALL col2 col0 FROM tab1 GROUP BY col2, col2
----
45
71
8

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

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-2858
SELECT DISTINCT - col2 col1, ( - 94 ) - - - 67 * + - col2 + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col2 HAVING - col1 BETWEEN ( NULL ) AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-2858
SELECT DISTINCT - col2 col1, ( - 94 ) - - - 67 * + - col2 + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col2 HAVING - col1 BETWEEN ( NULL ) AND NULL
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ( + + col2 ) col2, - col2 * + - 32 AS col1 FROM tab2 AS cor0 WHERE col0 + + 83 IS NULL GROUP BY col2, col2, col2 HAVING NULL IN ( 70 )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL - col0 * + 57 * col0 col2 FROM tab1 AS cor0 GROUP BY col0, col0, col0 HAVING NOT NULL NOT BETWEEN ( + col2 ) AND col2
................................................................................
query I rowsort label-2875
SELECT CASE - CAST( NULL AS SIGNED ) WHEN - col1 THEN + col0 - - 48 ELSE NULL END AS col2 FROM tab0 GROUP BY col1
----
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-2875
SELECT CASE - CAST ( NULL AS INTEGER ) WHEN - col1 THEN + col0 - - 48 ELSE NULL END AS col2 FROM tab0 GROUP BY col1
----
NULL
NULL

onlyif mysql # CAST syntax: SIGNED type: 
................................................................................
16
90

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL 76 + - col2 col2, col2 FROM tab2 GROUP BY col2
----
-11
87
-3
79
................................................................................
----

skipif mysql # not compatible
query II rowsort label-2938
SELECT + col1 - + ( - CAST ( NULL AS REAL ) ) + + + 71 * + ( - 27 ) AS col2, + col1 / + 63 - + col1 FROM tab2 GROUP BY col1 HAVING NULL > ( NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col2 + - ( - col2 ) col1, 3 FROM tab1 GROUP BY col2
----
142
3
16
3
................................................................................
NULL
NULL

query I rowsort
SELECT col2 AS col2 FROM tab0 AS cor0 WHERE NOT ( NULL ) IS NULL GROUP BY col2 HAVING NULL BETWEEN + 67 AND NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT CASE col2 WHEN - col2 THEN - AVG ( DISTINCT - col0 ) END AS col1 FROM tab1 cor0 GROUP BY col2 HAVING + col1 = NULL
----

query I rowsort
SELECT - col0 * - 93 FROM tab1 WHERE + col2 * + col1 * - 33 IS NULL GROUP BY col0
----
................................................................................
----

skipif mysql # not compatible
query I rowsort label-3063
SELECT ALL + col1 AS col0 FROM tab1 WHERE NULL > + + 71 * + - col2 + + col1 + - - CAST ( NULL AS INTEGER ) * col1 + + col2 + - col1 GROUP BY col0, col1
----

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

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

query I rowsort
SELECT DISTINCT - col0 * + 48 + col0 / 91 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( ( NULL ) IS NOT NULL )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col2 col2, col1 * + + col1 FROM tab0 AS cor0 WHERE NOT ( NULL ) > col2 GROUP BY col2, col1, col0, col1
----

query I rowsort
SELECT - 40 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - + 13 + 52 IS NOT NULL
----
................................................................................
query I rowsort label-3199
SELECT ALL col1 / - col1 AS col2 FROM tab2 GROUP BY col1
----
-1
-1
-1

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col2 * col1 - - ( + 11 ) * col0 * - col0 col1, col2 / - - 90 - - 82 FROM tab0 AS cor0 GROUP BY col2, col0, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col2 + col2 + + - col2 * - 10 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
................................................................................
456
948

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

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

query I rowsort
SELECT - col1 + + + 63 AS col0 FROM tab0 GROUP BY col1
----
................................................................................
-16
-91
-16
-92
-16

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-3207
SELECT + ( - col0 ) col1, + CAST ( - 16 AS INTEGER ) AS col2 FROM tab2 AS cor0 GROUP BY col0
----
-15
-16
-91
-16
................................................................................
query I rowsort
SELECT DISTINCT col0 - + - col0 FROM tab1 GROUP BY col0
----
164
44
56

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 + + col1 + 10 * - 81 * COALESCE ( 7, + 91 + col1 + ( + col2 ) ) + - - col1 AS col1 FROM tab1 GROUP BY col1 HAVING NOT ( col1 = NULL )
----

query I rowsort
SELECT - + 63 * 7 + - - col1 * col1 AS col1 FROM tab0 AS cor0 GROUP BY col1
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3333
SELECT DISTINCT + col0 + COALESCE ( ( + 53 ), - CAST( NULL AS SIGNED ) * NULLIF ( - col2, - col1 ) ) AS col1 FROM tab1 WHERE ( - col0 ) = NULL GROUP BY col0, col2, col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3333
SELECT DISTINCT + col0 + COALESCE ( ( + 53 ), - CAST ( NULL AS INTEGER ) * NULLIF ( - col2, - col1 ) ) AS col1 FROM tab1 WHERE ( - col0 ) = NULL GROUP BY col0, col2, col2
----

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 50, col1 ) FROM tab1 GROUP BY col2 HAVING NOT NULL <= + - ( + - 58 ) + + + col2
----

query I rowsort
SELECT + + 54 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
................................................................................
query I rowsort
SELECT DISTINCT + col1 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING ( NOT NULL IS NOT NULL )
----
44
57
6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + 52 * + col2 + - col2 col0, + col1 * - col1 FROM tab0 GROUP BY col1, col2
----
1224
-6561
1938
0
................................................................................
57
6

query I rowsort
SELECT DISTINCT + - col0 AS col0 FROM tab2 WHERE NOT NULL <= + 48 * + + 99 * + + col2 * + 45 GROUP BY col0 HAVING NOT + col0 IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT + 38, + COALESCE ( - - COALESCE ( - 46, + - col1 ), + 74 ) AS col0 FROM tab2 GROUP BY col0
----
38
-46

query I rowsort
................................................................................
query I rowsort
SELECT ALL ( - col2 ) + - - col2 - - 93 AS col0 FROM tab1 GROUP BY col2
----
93
93
93

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

query I rowsort
SELECT DISTINCT + col1 * 26 - + + col1 AS col0 FROM tab0 GROUP BY col1
----
................................................................................
query I rowsort
SELECT ALL ( - - col2 ) AS col1 FROM tab1 GROUP BY col2
----
45
71
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col0 col1, 78 - - col0 - 65 + - + 50 * - + ( col2 ) FROM tab0 AS cor0 GROUP BY col2, col0
----
26
3989
43
1256
................................................................................
1

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + - 75 AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL NOT BETWEEN - - col0 + 12 AND ( - 59 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3571
SELECT DISTINCT - - CAST( NULL AS SIGNED ) AS col1, col1 AS col2 FROM tab2 cor0 GROUP BY col1 HAVING NOT ( ( NULL IS NULL ) )
................................................................................
SELECT ALL COALESCE ( - 83, + - ( col2 ) * - - col0 * CAST( + col1 AS SIGNED ) ) FROM tab1 GROUP BY col1
----
-83
-83
-83

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3589
SELECT ALL COALESCE ( - 83, + - ( col2 ) * - - col0 * CAST ( + col1 AS INTEGER ) ) FROM tab1 GROUP BY col1
----
-83
-83
-83

................................................................................
query I rowsort label-3648
SELECT + col2 + - col2 * - ( CAST ( NULL AS INTEGER ) ) AS col1 FROM tab1 GROUP BY col2
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT + 35, + col2 * - 15 AS col1 FROM tab0 GROUP BY col0, col2 HAVING NOT NULL > - col1 * + 42 * - col0 + + col2 + - col1
----

query I rowsort
SELECT - + col0 / col0 FROM tab1 AS cor0 WHERE + 44 = + - col1 GROUP BY col1, col0, col1 HAVING NOT ( NULL ) NOT BETWEEN 61 AND ( NULL )
----
................................................................................
query I rowsort
SELECT DISTINCT + ( + 48 ) + - - 94 + + 86 * col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
2034
2550
7194

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col1 * - col1 * - COALESCE ( 30, 14, - col0 + 5 ) FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT ALL - 12 AS col1 FROM tab0 GROUP BY col2
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3701
SELECT DISTINCT - 14 - col0 AS col2 FROM tab1 AS cor0 WHERE NULL <> col2 - - col2 GROUP BY col0 HAVING NOT + CAST( - col2 AS SIGNED ) * col0 + - col2 / - 81 BETWEEN NULL AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3701
SELECT DISTINCT - 14 - col0 AS col2 FROM tab1 AS cor0 WHERE NULL <> col2 - - col2 GROUP BY col0 HAVING NOT + CAST ( - col2 AS INTEGER ) * col0 + - col2 / - 81 BETWEEN NULL AND NULL
----

query I rowsort
SELECT - col1 + - col2 * col1 FROM tab1 GROUP BY col2, col1
----
................................................................................
SELECT - CAST ( 70 AS INTEGER ) / + col2 FROM tab1 WHERE NOT ( 46 ) IS NOT NULL GROUP BY col2 HAVING NULL IS NULL
----

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

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

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3714
SELECT col2 AS col0 FROM tab1 GROUP BY col2 HAVING NOT ( - CAST( NULL AS SIGNED ) ) <= + 43
................................................................................
-1
67
-1
69
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-3821
SELECT ALL 8 + - - col1 col2, col1 / - col1 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1
----
49
-1
67
-1
................................................................................
query I rowsort
SELECT DISTINCT + 28 + - col2 * - col2 AS col0 FROM tab0 GROUP BY col2
----
1472
604
6269

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

query I rowsort
SELECT + col1 * - col0 + 76 AS col1 FROM tab0 GROUP BY col0, col1 HAVING NULL < COALESCE ( - + col0, col0 ) AND ( NULL ) IS NOT NULL
----
................................................................................
SELECT + COALESCE ( 83, - - col0 DIV CASE col0 WHEN col1 THEN NULL WHEN col0 THEN - col1 END ) FROM tab1 AS cor0 GROUP BY col1
----
83
83
83

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3916
SELECT + COALESCE ( 83, - - col0 / CASE col0 WHEN col1 THEN NULL WHEN col0 THEN - col1 END ) FROM tab1 AS cor0 GROUP BY col1
----
83
83
83

................................................................................

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-3946
SELECT DISTINCT col1 AS col0, - CAST( NULL AS DECIMAL ) + col1 AS col1 FROM tab0 GROUP BY col1, col1 HAVING + 22 * + 61 + - - col0 > NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-3946
SELECT DISTINCT col1 AS col0, - CAST ( NULL AS REAL ) + col1 AS col1 FROM tab0 GROUP BY col1, col1 HAVING + 22 * + 61 + - - col0 > NULL
----

query I rowsort
SELECT ALL col0 FROM tab2 AS cor0 GROUP BY col1, col1, col0 HAVING - col1 * - 13 + col0 + - 27 + - + 61 IS NULL
----
................................................................................
15
-44
15
-57
15
-6

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT col1 * - col1 * col1 + - + col1 AS col2, col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) BETWEEN + ( - col1 ) AND + col2 + - 3
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT ( + col0 ) col0 FROM tab2 GROUP BY col0 HAVING NULL IS NULL
................................................................................
query I rowsort label-4054
SELECT + CAST ( + + 96 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col0, col1
----
96
96
96

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

onlyif mysql # DIV for integer division: 
query I rowsort label-4056
SELECT DISTINCT + col0 DIV - - col0 FROM tab2 GROUP BY col0, col0
................................................................................
query I rowsort
SELECT ALL + col2 * - 83 * NULLIF ( - 83, - 11 ) FROM tab2 AS cor0 GROUP BY col1, col2
----
399562
544231
599343

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT + - NULLIF ( + col1, - col0 ) * - AVG ( DISTINCT 35 ) >= NULL
----

query I rowsort
SELECT col2 * - + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
................................................................................
225
1
8281
1
8464

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4219
SELECT ALL col0 / + col0 col1, + col0 * col0 FROM tab2 AS cor0 GROUP BY col0
----
1
225
1
8281
................................................................................
----

skipif mysql # not compatible
query I rowsort label-4228
SELECT ALL + ( col0 ) FROM tab1 GROUP BY col0, col2 HAVING NULL NOT IN ( + col2 / - - 92 / - col2 * - col0, + COALESCE ( + + CAST ( - - col2 AS INTEGER ), - col0 ) )
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - + 75 col0, 23 FROM tab1 cor0 GROUP BY col2
----
-75
23
-75
23
................................................................................
1

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - + col1 * - col1 + + col1 col0, - 28 FROM tab0 cor0 GROUP BY col1, col1
----
0
-28
6642
-28
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4415
SELECT DISTINCT COALESCE ( + 90, ( 11 ) + - col1 * + CAST( NULL AS SIGNED ), col0 - col0 ) + - col0 FROM tab0 GROUP BY col0 HAVING NOT ( col0 ) <> NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4415
SELECT DISTINCT COALESCE ( + 90, ( 11 ) + - col1 * + CAST ( NULL AS INTEGER ), col0 - col0 ) + - col0 FROM tab0 GROUP BY col0 HAVING NOT ( col0 ) <> NULL
----

query I rowsort
SELECT 52 FROM tab0 GROUP BY col1, col0, col1 HAVING col0 <= ( NULL )
----
................................................................................
SELECT ALL col0 AS col0 FROM tab1 GROUP BY col0 HAVING + CAST ( ( col0 ) AS INTEGER ) IS NULL
----

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col1 * 98 * + COALESCE ( + 7, - col2 ) - col1 * col1 AS col1 FROM tab0 GROUP BY col1
----
0
49005

onlyif mysql # DIV for integer division: 
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4506
SELECT ALL - col0 + + col0 AS col1 FROM tab0 WHERE col1 IN ( CAST( col0 AS SIGNED ) ) GROUP BY col0 HAVING NOT CAST( NULL AS SIGNED ) <= ( - col1 + + col1 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4506
SELECT ALL - col0 + + col0 AS col1 FROM tab0 WHERE col1 IN ( CAST ( col0 AS INTEGER ) ) GROUP BY col0 HAVING NOT CAST ( NULL AS INTEGER ) <= ( - col1 + + col1 )
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab1 GROUP BY col0, col0
----
................................................................................
query I rowsort label-4548
SELECT DISTINCT CAST ( ( - 67 ) AS INTEGER ) + + - col0 FROM tab1 cor0 GROUP BY col0, col2
----
-149
-89
-95

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - + col2 * col2 + - ( col1 ) col0, col2 * col2 * col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1
----
-1444
54872
-6241
493039
................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4558
SELECT DISTINCT CASE - 59 WHEN 88 THEN - col0 * + + col2 + - 25 + - + CAST( + col0 AS SIGNED ) END AS col1 FROM tab2 AS cor0 GROUP BY col1
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4558
SELECT DISTINCT CASE - 59 WHEN 88 THEN - col0 * + + col2 + - 25 + - + CAST ( + col0 AS INTEGER ) END AS col1 FROM tab2 AS cor0 GROUP BY col1
----
NULL

query I rowsort
SELECT - + 68 FROM tab1 AS cor0 GROUP BY col0, col1, col2
................................................................................
NULL
91
NULL
92
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4572
SELECT col0 col2, CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col0
----
15
NULL
91
NULL
................................................................................
query I rowsort
SELECT + + col1 * 56 FROM tab1 AS cor0 GROUP BY col1, col1
----
2464
3192
336

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

query I rowsort
SELECT - 33 FROM tab2 GROUP BY col2
----
................................................................................
44
NULL
57
NULL
6

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4586
SELECT ALL CAST ( NULL AS INTEGER ) - col1 * - AVG ( + 13 ) col0, col1 AS col2 FROM tab1 GROUP BY col1, col1
----
NULL
44
NULL
57
................................................................................
query I rowsort
SELECT + col1 * + 99 AS col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
0
0
8019

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( + + ( + 22 ), + - 99 * + - CASE + - col0 WHEN - col0 THEN - col2 ELSE NULL END * + col0 - + col0 ) FROM tab1 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
22
22
22

................................................................................
SELECT col2 AS col2 FROM tab1 GROUP BY col2 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT 7 + - col1 FROM tab0 GROUP BY col1, col0, col2 HAVING NOT NULL BETWEEN + - COALESCE ( + - 37, - col1 - - + col1 ) AND col1
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT col2 + + CASE + - 82 WHEN - 28 THEN - col0 + - col2 END AS col1, - col1 / + col1 FROM tab0 GROUP BY col1, col2 HAVING + col1 > col1
----

query II rowsort
SELECT - col0 AS col0, 54 AS col0 FROM tab2 GROUP BY col0, col0, col0
----
................................................................................
SELECT DISTINCT - ( + - col2 ) FROM tab2 cor0 GROUP BY col2, col0 HAVING NULL < + + col0
----

query I rowsort
SELECT col1 * + + col1 FROM tab2 cor0 GROUP BY col0, col1, col1 HAVING NOT + 56 > + 45
----

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

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4677
SELECT - col1 - + + CAST( NULL AS SIGNED ) AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING ( - col0 * + + col0 + - col1 ) IS NOT NULL
................................................................................
query I rowsort
SELECT - 30 FROM tab1 GROUP BY col2, col1
----
-30
-30
-30

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

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4694
SELECT DISTINCT col0 - col1, col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING ( NULL ) <> + col2 - + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-4694
SELECT DISTINCT col0 - col1, col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING ( NULL ) <> + col2 - + CAST ( NULL AS INTEGER )
----

query I rowsort
SELECT - col2 * - + col2 * 85 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
................................................................................
query I rowsort
SELECT DISTINCT - + 78 + col1 col0 FROM tab2 cor0 GROUP BY col1, col2
----
-17
-19
-37

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + 85 * - + col2 + - - col2 + 54 + + 58 + - col2 * + col2 * - col2 / + - col2 AS col0 FROM tab2 cor0 GROUP BY col2 HAVING NOT 79 * - + col2 * - col0 >= NULL
----

query I rowsort
SELECT ALL + 83 FROM tab0 GROUP BY col2, col0
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4864
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL = ( col0 + 42 * - CAST( + 33 AS SIGNED ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4864
SELECT DISTINCT col2 AS col0 FROM tab0 GROUP BY col2 HAVING NOT NULL = ( col0 + 42 * - CAST ( + 33 AS INTEGER ) )
----

query I rowsort
SELECT ALL 15 AS col0 FROM tab2 GROUP BY col1 HAVING ( NULL ) IS NULL
----
................................................................................
SELECT + COALESCE ( + 85, col0 DIV + ( col2 ) ) FROM tab0 AS cor0 GROUP BY col0
----
85
85
85

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4887
SELECT + COALESCE ( + 85, col0 / + ( col2 ) ) FROM tab0 AS cor0 GROUP BY col0
----
85
85
85

................................................................................
SELECT DISTINCT + - AVG ( + - col0 ) AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NULL IS NOT NULL
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + + 80 * + col1 col2, ( - col1 ) FROM tab1 AS cor0 GROUP BY col2, col1
----
3520
-44
4560
-57
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4915
SELECT DISTINCT + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL < - col2 * CAST( col2 AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4915
SELECT DISTINCT + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NOT NULL < - col2 * CAST ( col2 AS INTEGER )
----

query I rowsort
SELECT ALL col0 AS col2 FROM tab0 GROUP BY col0, col1
----
................................................................................
query I rowsort
SELECT col1 + + 27 + + 19 * - col2 AS col0 FROM tab0 GROUP BY col1, col2
----
-1474
-348
-695

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 * + col1 * - col1 AS col0 FROM tab2 GROUP BY col1, col2 HAVING NOT NULL BETWEEN col0 AND - - NULLIF ( col0, col0 * - col2 / + col0 )
----

query I rowsort
SELECT ALL - 29 * - col1 - - col1 * + - 39 AS col1 FROM tab1 AS cor0 GROUP BY col1
----
................................................................................
query I rowsort
SELECT DISTINCT + 16 * + col2 FROM tab2 AS cor0 GROUP BY col2, col2
----
1264
1392
928

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + 6 col1, - 40 FROM tab2 GROUP BY col0 HAVING NULL NOT IN ( - col1 * col1 * - col1 - - + 84, 62 - + 15 * + col1 )
----

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT ( - + col1 ) AS col2, + 69 * col1 + - + AVG ( DISTINCT - col1 ) + + 17 AS col2 FROM tab0 GROUP BY col1 HAVING NOT 42 * - col2 = NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5024
SELECT - - col0 + CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) AS col1, col0 AS col2 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL > - 21
................................................................................
query I rowsort label-5060
SELECT ALL - 84 + - + col2 + - col2 / - col2 col1 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT col2 IS NULL
----
-107
-121
-162

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col1, col1 FROM tab1 GROUP BY col1
----
44
44
57
57
................................................................................
-1

query I rowsort
SELECT DISTINCT - 22 AS col0 FROM tab1 WHERE NOT - ( + COALESCE ( - + 77, + - 49 ) ) + - ( + - 33 ) + col0 IN ( + 35 ) GROUP BY col1
----
-22

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + col1 + col1 + COALESCE ( - + 65, + + ( col0 ) ) AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT ( NOT ( + col1 ) IS NOT NULL )
----
-65
97

query I rowsort
................................................................................
SELECT ALL - col2 FROM tab0 AS cor0 WHERE NULL = NULL AND - 24 * - COALESCE ( + col1, COALESCE ( 61, 72 * ( + col0 * col0 ), 55 ) + - col1, + 46 ) < + col1 GROUP BY col2, col1 HAVING NULL NOT IN ( + 62 )
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col1 - CASE ( + - col1 ) WHEN + - 2 THEN + 56 END col0 FROM tab2 cor0 GROUP BY col1
----
NULL
NULL
NULL

................................................................................
query I rowsort label-5208
SELECT ALL - col1 * col1 + 29 + - - col1 / + - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-1653
-3453
-3693

skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort
SELECT col2 / - col2 + col2 * - col2 AS col1, 67 col1, 24 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
9 values hashing to 442b706f32baefbb061d0cc9d3a2d7a7

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

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5293
SELECT 59 col0, + CAST( - col0 AS SIGNED ) AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5293
SELECT 59 col0, + CAST ( - col0 AS INTEGER ) AS col0 FROM tab1 GROUP BY col0 HAVING NOT NULL IS NULL
----

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

skipif mysql # not compatible
query II rowsort label-5304
SELECT - col0 / - 47 + - + col0 AS col0, col0 AS col1 FROM tab2 AS cor0 WHERE NOT - CAST ( NULL AS INTEGER ) IS NULL GROUP BY col0 HAVING NULL > - 30 + - CAST ( NULL AS INTEGER )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT - 1, 9 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NOT - 76 = - ( col2 ) + COALESCE ( + + 86, + + col0 )
----
-1
9

query I rowsort
................................................................................
SELECT - + col1 * + col1 * + NULLIF ( - CAST( NULL AS SIGNED ), + - 27 * + + NULLIF ( - col0, col1 * 9 ) ) + - + 78 + col1 + - + col1 * 26 / col1 / + AVG ( ALL + 6 ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5317
SELECT - + col1 * + col1 * + NULLIF ( - CAST ( NULL AS INTEGER ), + - 27 * + + NULLIF ( - col0, col1 * 9 ) ) + - + 78 + col1 + - + col1 * 26 / col1 / + AVG ( ALL + 6 ) FROM tab1 AS cor0 GROUP BY col1
----
NULL
NULL
NULL

................................................................................
query I rowsort
SELECT DISTINCT col0 - col0 * - 65 FROM tab0 AS cor0 GROUP BY col0
----
1716
2838
5478

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

query I rowsort
SELECT col2 + + col0 FROM tab1 AS cor0 GROUP BY col0, col2
----
................................................................................
query I rowsort
SELECT DISTINCT + col0 * + 56 FROM tab2 AS cor0 GROUP BY col0, col2
----
5096
5152
840

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

onlyif mysql # DIV for integer division: 
query II rowsort label-5508
SELECT col0 DIV - 46 AS col1, col0 + - - col0 AS col0 FROM tab2 GROUP BY col0 HAVING NOT 33 IS NULL
................................................................................
----
3

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - - 2 * - + col2 col0, ( - col1 ) + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING NULL <= + col2
----

query I rowsort
SELECT - - col1 FROM tab2 AS cor0 GROUP BY col1, col1 HAVING NOT - 93 NOT BETWEEN - col1 / - 99 AND NULL
----
................................................................................
query I rowsort
SELECT 76 FROM tab2 GROUP BY col2
----
76
76
76

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col1 / + 8 col1, col1 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NOT ( NULL ) <> col0
----

query II rowsort
SELECT ALL col2 * col1 + + - col2 AS col1, + 71 / - col1 * - COALESCE ( + col2, + col1 + - col1 ) AS col2 FROM tab1 GROUP BY col1, col2 HAVING NULL <= 4
----
................................................................................
-118
-98

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort
SELECT DISTINCT 20 + - col2 AS col0, + col2 col0, - 95 AS col0 FROM tab2 AS cor0 GROUP BY col2
----
9 values hashing to 44912f0b8cb9b18845e83ac435de9c5f

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5636
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5669
SELECT ALL CAST( 59 AS SIGNED ) AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL BETWEEN col1 * - 34 AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5669
SELECT ALL CAST ( 59 AS INTEGER ) AS col1 FROM tab1 GROUP BY col0 HAVING NOT NULL BETWEEN col1 * - 34 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-5670
SELECT ALL + 68 * - CAST( NULL AS SIGNED ) / + col2 * - + col2 AS col0, col2 * + col2 - 2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
................................................................................
SELECT + 34 + - col0 + COALESCE ( 7, 29 * col0, + col0 * + CAST( 29 * + col2 AS SIGNED ) ) * col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-49
558
8

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5709
SELECT + 34 + - col0 + COALESCE ( 7, 29 * col0, + col0 * + CAST ( 29 * + col2 AS INTEGER ) ) * col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col0
----
-49
558
8

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT - col1 + + 77, col1 * + - 34 AS col2 FROM tab2 GROUP BY col1 HAVING col2 BETWEEN ( NULL ) AND ( NULL )
----

query I rowsort
SELECT DISTINCT 2 AS col0 FROM tab0 GROUP BY col1
----
................................................................................

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5719
SELECT ALL + col2 * 94 - + 68 + - + col2 * col2 + - + CASE - 2 WHEN - CAST( + 60 AS DECIMAL ) THEN + 38 END AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NULL <= + + col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5719
SELECT ALL + col2 * 94 - + 68 + - + col2 * col2 + - + CASE - 2 WHEN - CAST ( + 60 AS REAL ) THEN + 38 END AS col1 FROM tab1 cor0 GROUP BY col2 HAVING NULL <= + + col1
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 47 + - + col2 col2, 17 FROM tab0 GROUP BY col2 HAVING NOT col2 >= AVG ( - 86 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5751
SELECT - col0 * + - col0 AS col2 FROM tab2 AS cor0 WHERE - col0 IN ( - col1, - col0, + col2, + - 36 * + 54 * + CAST( - col0 AS SIGNED ), - col2 + - ( - col1 ), col1 ) GROUP BY col2, col0
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5790
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT ( col0 * + CAST( 14 / + col0 AS SIGNED ) > NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5790
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1 HAVING NOT ( col0 * + CAST ( 14 / + col0 AS INTEGER ) > NULL )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5791
SELECT - CAST( NULL AS DECIMAL ) FROM tab2 GROUP BY col1, col1
................................................................................
SELECT 12 AS col2 FROM tab0 GROUP BY col0, col1, col2 HAVING NOT ( NULL IS NULL )
----

query I rowsort
SELECT + 11 * + - col0 * - col0 / - 97 FROM tab2 cor0 WHERE col2 IS NULL GROUP BY col0
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + col1 * 84 + ( + - 68 ) col1, col2 AS col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING ( NULL ) IS NOT NULL
----

query I rowsort
SELECT + 0 FROM tab0 AS cor0 GROUP BY col2
----
................................................................................
query I rowsort
SELECT ALL col0 + 9 FROM tab1 AS cor0 GROUP BY col0
----
31
37
91

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 59 col0, - col2 AS col0 FROM tab1 GROUP BY col2
----
59
-45
59
-71
................................................................................
query I rowsort
SELECT + col0 * 79 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0
----
1738
2212
6478

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

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5924
SELECT DISTINCT col1 - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT - CAST( NULL AS SIGNED ) / - col1 + + col1 <> NULL
................................................................................
query I rowsort
SELECT 48 FROM tab1 GROUP BY col2
----
48
48
48

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ( col2 ) AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL <> + 14 / - col2 * 34 + 1 + - col1 / col1 * col2
----

query I rowsort
SELECT ALL 86 FROM tab0 GROUP BY col0 HAVING NULL IS NULL
----
................................................................................
query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab1 GROUP BY col1, col0
----
-22
-28
-82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT 71 AS col1 FROM tab2 GROUP BY col2 HAVING NOT NULL NOT BETWEEN NULL AND - col1 / + col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6089
SELECT DISTINCT + CAST( NULL AS SIGNED ) AS col0 FROM tab0 AS cor0 WHERE - 29 IS NULL GROUP BY col0, col2 HAVING + col2 IS NULL
................................................................................
----

skipif mysql # not compatible
query I rowsort label-6089
SELECT DISTINCT + CAST ( NULL AS INTEGER ) AS col0 FROM tab0 AS cor0 WHERE - 29 IS NULL GROUP BY col0, col2 HAVING + col2 IS NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( 47, col2 ) FROM tab0 AS cor0 GROUP BY col0, col0
----
47
47
47

................................................................................
49
49

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - ( - 68 ) col2, col2 * - 47 FROM tab2 cor0 GROUP BY col2 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT DISTINCT + col1 AS col2 FROM tab1 WHERE NULL BETWEEN + + col2 AND NULL GROUP BY col1
----
................................................................................
query I rowsort label-6116
SELECT - + 76 / col2 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-1
-1
-9

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + - col1 col0, + col1 * col1 FROM tab0 WHERE - + 42 NOT BETWEEN + ( + + col0 ) AND + col0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
6561
0
0
................................................................................
-12
-88

query I rowsort
SELECT - 86 AS col0 FROM tab1 AS cor0 WHERE NOT NULL BETWEEN - 11 + 20 AND - + col2 GROUP BY col2
----

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

query II rowsort
SELECT - - 9 * + - 82, 98 FROM tab0 AS cor0 GROUP BY col0, col2 HAVING NOT ( NULL ) IS NULL
----

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

query II rowsort
SELECT ALL + col0, col0 FROM tab2 GROUP BY col0 HAVING 46 IS NULL
----
................................................................................

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + col2 AS col0 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT NULL <> + NULLIF ( - col0, 49 ) + - 92
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - col1 * col1 col2 FROM tab1 AS cor0 GROUP BY col1
................................................................................
query I rowsort label-6212
SELECT col0 * col0 / + col0 FROM tab2 GROUP BY col0 HAVING ( ( + 13 ) - - col0 ) <> + 39 - - col0 + - 79 * - 78
----
15
91
92

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

query I rowsort
SELECT col1 - + col1 * - - ( col1 ) AS col0 FROM tab1 GROUP BY col1
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6239
SELECT ALL + col2 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT ( + 1 ) IN ( + CASE + ( col0 ) WHEN 79 * + CAST( NULL AS SIGNED ) THEN col1 END )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6239
SELECT ALL + col2 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT ( + 1 ) IN ( + CASE + ( col0 ) WHEN 79 * + CAST ( NULL AS INTEGER ) THEN col1 END )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-6240
SELECT + col1 - + 72 DIV + 35 + + col1 AS col1 FROM tab0 GROUP BY col1, col0, col2
................................................................................
SELECT + - 5 * + + NULLIF ( + CAST( NULL AS SIGNED ), - NULLIF ( col0, col0 * CAST( + 64 AS SIGNED ) ) * 91 + - col1 ) FROM tab0 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6255
SELECT + - 5 * + + NULLIF ( + CAST ( NULL AS INTEGER ), - NULLIF ( col0, col0 * CAST ( + 64 AS INTEGER ) ) * 91 + - col1 ) FROM tab0 AS cor0 GROUP BY col0, col0
----
NULL
NULL
NULL

................................................................................
----
6111
-30
6111
-5

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6283
SELECT DISTINCT 97 * + 63 col1, - col0 / - - 3 AS col1 FROM tab2 GROUP BY col0, col0
----
6111
-30
6111
-5
................................................................................
query I rowsort
SELECT + + col2 - + col1 col2 FROM tab0 AS cor0 GROUP BY col2, col1, col2
----
-57
38
79

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

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

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-6416
SELECT ALL col2 col2, col2 FROM tab2 WHERE CAST( NULL AS DECIMAL ) >= + col1 GROUP BY col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6416
SELECT ALL col2 col2, col2 FROM tab2 WHERE CAST ( NULL AS REAL ) >= + col1 GROUP BY col2
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT - - col0 col1 FROM tab1 cor0 GROUP BY col0
................................................................................
query I rowsort label-6420
SELECT DISTINCT ( + 4 ) + - col2 / + 17 FROM tab2 GROUP BY col2
----
-1
0
1

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

onlyif mysql # DIV for integer division: 
query I rowsort label-6422
SELECT DISTINCT - 45 DIV + col1 col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
................................................................................
query I rowsort
SELECT + + ( - col2 ) col2 FROM tab1 AS cor0 GROUP BY col1, col2
----
-45
-71
-8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col1 col2, - col1 * col1 FROM tab0 GROUP BY col1
----
0
0
81
-6561
................................................................................
query I rowsort
SELECT col0 + 70 FROM tab0 GROUP BY col0, col2
----
113
153
96

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT CASE - - 38 WHEN + col1 THEN - col2 END col0 FROM tab1 GROUP BY col1, col2, col1
----
NULL
NULL
NULL

................................................................................
-43
-83

query II rowsort
SELECT ALL col0 * - col2 * + col0 * - + 98, - col2 + - 70 AS col1 FROM tab2 GROUP BY col0, col2 HAVING ( NOT - - col0 IS NOT NULL )
----

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

query I rowsort
SELECT 31 * - col2 + + - 17 AS col2 FROM tab0 AS cor0 GROUP BY col2, col0
----
................................................................................
51
51

query I rowsort
SELECT ALL 8 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT ( NULL ) <> - 78
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( + 10, - - col2 + - 67, - + 99 ) * + 93 FROM tab1 GROUP BY col0, col0
----
-930
-930
-930

................................................................................
query I rowsort label-6659
SELECT + ( - CAST ( NULL AS INTEGER ) ) + 36 * - - 0 FROM tab2 AS cor0 GROUP BY col0
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 * - col2 col2, col0 AS col2 FROM tab2 GROUP BY col2, col0 HAVING 93 / col2 + - col2 IS NOT NULL
----
-1305
15
-5336
92
................................................................................
NULL
-1
NULL
-1
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-6688
SELECT ALL col1 / - col1, + CASE + - 33 WHEN + 66 THEN col0 + + col2 + - - col1 + - - col0 * + col0 ELSE NULL END AS col0 FROM tab2 GROUP BY col1
----
-1
NULL
-1
NULL
................................................................................
----
1

query I rowsort
SELECT ALL col0 + - col0 AS col1 FROM tab0 WHERE col1 + col0 < ( NULL ) GROUP BY col0 HAVING - 63 BETWEEN + col0 AND + col0
----

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

query I rowsort
SELECT col0 FROM tab0 GROUP BY col0 HAVING NOT 71 >= NULL
----
................................................................................
30
30

query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 cor0 WHERE ( - 88 ) NOT BETWEEN NULL AND NULL GROUP BY col0 HAVING NULL = ( - 15 )
----

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

query I rowsort
SELECT ALL + col2 FROM tab1 AS cor0 GROUP BY col0, col2 HAVING NOT NULL >= 17
----
................................................................................
query I rowsort
SELECT + 45 - - col0 AS col1 FROM tab2 GROUP BY col0
----
136
137
60

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT 19 AS col2 FROM tab2 GROUP BY col0, col1, col1 HAVING NULL NOT BETWEEN + - NULLIF ( + - col2, - + ( + 2 ) ) AND + col2
----

query I rowsort
SELECT 21 AS col0 FROM tab2 GROUP BY col2
----
................................................................................
-74

query I rowsort
SELECT DISTINCT - 54 FROM tab1 cor0 GROUP BY col0
----
-54

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT 1 - + ( + - 97 ) col0, - col1 AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL > ( NULL )
----

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

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query I rowsort label-6908
SELECT - + ( CAST( + + CAST( - col0 AS DECIMAL ) AS SIGNED ) ) + - + COALESCE ( - + 27, + - col1, + col0 ) * + col0 + - ( + col0 ) - - 6 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN - col2 + - 97 * - col2 AND - ( col2 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6908
SELECT - + ( CAST ( + + CAST ( - col0 AS REAL ) AS INTEGER ) ) + - + COALESCE ( - + 27, + - col1, + col0 ) * + col0 + - ( + col0 ) - - 6 AS col2 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NOT NULL NOT BETWEEN - col2 + - 97 * - col2 AND - ( col2 )
----

query I rowsort
SELECT DISTINCT - col2 FROM tab2 cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----
................................................................................
SELECT DISTINCT + col0 FROM tab2 AS cor0 WHERE NOT ( NOT + 74 < col0 * + col1 + + 95 ) GROUP BY col0, col0 HAVING NOT NULL > - 40
----

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT + 20 AS col2, - COALESCE ( + 41, - + col0 + + + 75 ) / + - 8 * - ( - col2 ) AS col2 FROM tab2 WHERE + 73 IS NOT NULL GROUP BY col2, col2 HAVING + 58 * 6 BETWEEN NULL AND + col2
----

query II rowsort
SELECT ALL 46, + col0 FROM tab1 GROUP BY col2, col0
----
................................................................................

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-6993
SELECT 49 col2, + col0 / + - 43 - - 14 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) < + - 27 - + NULLIF ( - + col0, CAST( + col0 AS DECIMAL ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6993
SELECT 49 col2, + col0 / + - 43 - - 14 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT ( NULL ) < + - 27 - + NULLIF ( - + col0, CAST ( + col0 AS REAL ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6994
SELECT - ( - + 16 ) / + CAST( NULL AS SIGNED ) * + 20 FROM tab2 GROUP BY col0, col0
................................................................................
----

query I rowsort
SELECT DISTINCT - ( + 21 ) * + - 48 FROM tab1 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
1008

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

query I rowsort
SELECT ALL + - 94 + col1 + col1 * - ( + 16 ) FROM tab1 cor0 GROUP BY col1
----
................................................................................
query I rowsort label-7059
SELECT ALL + - CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 GROUP BY col1 HAVING + col1 IS NOT NULL
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 AS cor0 WHERE NOT ( - col2 + - ( + + col1 ) + + col0 + 31 * - ( + col0 ) ) BETWEEN NULL AND 52 GROUP BY col2 HAVING NULL <= - 87 * - col0 + - 59
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7061
SELECT DISTINCT + - CAST( NULL AS SIGNED ) * - - col0 FROM tab0 cor0 GROUP BY col0
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-7086
SELECT - col1 col2, 69 / - CAST( NULL AS SIGNED ) AS col1 FROM tab0 WHERE NOT NULL NOT BETWEEN - col2 AND + col1 GROUP BY col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7086
SELECT - col1 col2, 69 / - CAST ( NULL AS INTEGER ) AS col1 FROM tab0 WHERE NOT NULL NOT BETWEEN - col2 AND + col1 GROUP BY col1
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7087
SELECT + col0 + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col0
................................................................................
SELECT ( + CASE CAST( NULL AS SIGNED ) WHEN - - col1 THEN 0 / col1 END ) FROM tab1 WHERE + col2 IS NOT NULL GROUP BY col0, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7107
SELECT ( + CASE CAST ( NULL AS INTEGER ) WHEN - - col1 THEN 0 / col1 END ) FROM tab1 WHERE + col2 IS NOT NULL GROUP BY col0, col0
----
NULL
NULL
NULL

................................................................................
query I rowsort
SELECT ALL + col2 + + 37 FROM tab0 AS cor0 GROUP BY col2, col2
----
116
61
75

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT col2 AS col1, col2 AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT ( col1 ) BETWEEN NULL AND ( NULL )
----

query I rowsort
SELECT 90 AS col2 FROM tab0 GROUP BY col0, col0 HAVING NOT NULL BETWEEN NULL AND NULL
----
................................................................................
query I rowsort
SELECT ALL 7 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
7
7
7

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( col1, + + 68, ( + col2 ) ) AS col2 FROM tab2 AS cor0 GROUP BY col1, col1
----
41
59
61

................................................................................
624
988

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

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

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

skipif mysql # not compatible
query I rowsort label-7381
SELECT DISTINCT ( - CAST ( - - 52 AS INTEGER ) ) * - col1 + 7 * - 23 + col1 AS col1 FROM tab2 GROUP BY col1, col1, col0, col2 HAVING NOT + CAST ( - col2 AS REAL ) BETWEEN NULL AND ( - col0 + + col1 )
----

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

query I rowsort
SELECT DISTINCT col1 + + 9 FROM tab0 GROUP BY col1
----
................................................................................
----
1944

query I rowsort
SELECT ALL - col1 + col1 * - col1 FROM tab1 AS cor0 WHERE 48 * - col1 IN ( 70 / 93 ) GROUP BY col1
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( 69, + col2 - - col2, col2 ) * - COALESCE ( - col0, + col0 ) FROM tab1 GROUP BY col0 HAVING NOT + 0 <> ( + 57 )
----

query I rowsort
SELECT - 55 AS col0 FROM tab0 GROUP BY col1 HAVING NOT + 91 IS NULL
----
................................................................................
----
-1

query I rowsort
SELECT DISTINCT + col0 * col0 + - 81 FROM tab0 AS cor0 WHERE NOT NULL IS NULL GROUP BY col1, col0 HAVING NOT AVG ( ALL 21 ) IS NOT NULL
----

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

onlyif mysql # DIV for integer division: 
query I rowsort label-7407
SELECT ALL - - col2 DIV + col2 + - COALESCE ( + 98 + - 95, col1 ) FROM tab2 cor0 GROUP BY col2
----
-2
-2
-2

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7407
SELECT ALL - - col2 / + col2 + - COALESCE ( + 98 + - 95, col1 ) FROM tab2 cor0 GROUP BY col2
----
-2
-2
-2

................................................................................
query I rowsort
SELECT COALESCE ( - 54, - 75 ) FROM tab0 AS cor0 GROUP BY col2
----
-54
-54
-54

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

query I rowsort
SELECT DISTINCT 89 AS col1 FROM tab0 GROUP BY col1, col1
----
................................................................................
SELECT col2 + - col2 + + COALESCE ( ( - 39 ), + ( + NULLIF ( + + CAST( + CAST( col2 AS SIGNED ) AS SIGNED ), - - col0 * ( 79 ) ) ) + col2, - + col2 * - col2 ) FROM tab0 GROUP BY col2, col2
----
-39
-39
-39

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7456
SELECT col2 + - col2 + + COALESCE ( ( - 39 ), + ( + NULLIF ( + + CAST ( + CAST ( col2 AS INTEGER ) AS INTEGER ), - - col0 * ( 79 ) ) ) + col2, - + col2 * - col2 ) FROM tab0 GROUP BY col2, col2
----
-39
-39
-39

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT CASE 42 WHEN - 99 THEN AVG ( 13 ) * - col1 - + col2 * + col2 END + + col2 FROM tab0 WHERE ( NULL ) NOT BETWEEN ( col1 ) AND ( - CASE WHEN col2 NOT BETWEEN NULL AND ( col2 + 48 ) THEN col1 ELSE + col2 * + col0 END ) GROUP BY col2 HAVING NOT NULL BETWEEN ( - col2 ) AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7512
SELECT ALL col0 / - COALESCE ( 87 * - 29, NULLIF ( col0, - col1 ) * - col1 + col0 ) FROM tab2 WHERE NOT col1 NOT BETWEEN - 11 + - CAST( NULL AS SIGNED ) * - CAST( - col1 AS SIGNED ) AND col0 GROUP BY col0, col0
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7512
SELECT ALL col0 / - COALESCE ( 87 * - 29, NULLIF ( col0, - col1 ) * - col1 + col0 ) FROM tab2 WHERE NOT col1 NOT BETWEEN - 11 + - CAST ( NULL AS INTEGER ) * - CAST ( - col1 AS INTEGER ) AND col0 GROUP BY col0, col0
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 + + 0 col0, col0 * + ( 52 ) FROM tab1 GROUP BY col0 HAVING - 58 < ( 2 + - 41 )
----
22
1144
28
1456
................................................................................
query I rowsort
SELECT 99 + col1 FROM tab2 GROUP BY col1, col1
----
140
158
160

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

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7564
SELECT ALL col0 * + CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) FROM tab2 cor0 GROUP BY col0
................................................................................
-24
24
-38
38
-79
79

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

skipif mysql # not compatible
query I rowsort label-7609
SELECT ALL + CAST ( - 27 AS INTEGER ) FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL >= - 26
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( - - 86, - + COALESCE ( col0, col1 + - col1 ) * - - ( + col0 ) ) AS col2 FROM tab0 GROUP BY col2
----
-86

query I rowsort
SELECT + 29 - + - col1 + - - 54 FROM tab0 GROUP BY col1, col0 HAVING NULL IS NOT NULL
................................................................................
query I rowsort label-7652
SELECT - CAST ( NULL AS INTEGER ) col2 FROM tab0 GROUP BY col2, col0
----
NULL
NULL
NULL

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

query I rowsort
SELECT ALL 57 FROM tab0 AS cor0 GROUP BY col1 HAVING col1 IS NOT NULL
----
................................................................................
SELECT col0 FROM tab0 GROUP BY col0 HAVING NOT ( NOT + 55 * 56 <= NULL )
----

query I rowsort
SELECT - col1 FROM tab0 AS cor0 WHERE NULL IN ( - col1 ) GROUP BY col0, col1
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL + COALESCE ( 34, - col1 * - col0 + + + 60 ), 32 AS col1 FROM tab0 cor0 GROUP BY col2, col0 HAVING + 30 > - col0 * 14
----
34
32
34
32
................................................................................
SELECT - col2 / col2 * - 44 / - col1 AS col1 FROM tab0 GROUP BY col2, col2, col1 HAVING NULL < + + col2
----

query I rowsort
SELECT col2 AS col0 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING - 33 = + col2
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( - 72, - + col0 * - - col2 + - + col1 ) FROM tab1 GROUP BY col1
----
72
72
72

................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7733
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL BETWEEN ( - col1 / CAST( col2 AS SIGNED ) ) AND ( 13 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7733
SELECT col1 AS col2 FROM tab2 GROUP BY col1 HAVING NULL BETWEEN ( - col1 / CAST ( col2 AS INTEGER ) ) AND ( 13 )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( + 0, col1 ) FROM tab1 GROUP BY col2 HAVING NOT NULL > NULL
----

query I rowsort
SELECT 66 FROM tab2 GROUP BY col2
----
................................................................................
NULL
22
NULL
28
NULL
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 89, + col2 ) FROM tab0 cor0 GROUP BY col1
----
89
89

query I rowsort
................................................................................
-3364
-3364
-6241
-6241
-7569
-7569

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 36 * + + 81 col1, + col2 FROM tab1 GROUP BY col2
----
2916
45
2916
71
................................................................................

onlyif mysql # CAST syntax: SIGNED type: DECIMAL type: 
query II rowsort label-8045
SELECT - + 63 + - 36 AS col2, + NULLIF ( - CAST( NULL AS SIGNED ), + col2 ) + - + col0 / - 32 / + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + CAST( NULL AS DECIMAL ) > ( - + 7 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-8045
SELECT - + 63 + - 36 AS col2, + NULLIF ( - CAST ( NULL AS INTEGER ), + col2 ) + - + col0 / - 32 / + col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT + CAST ( NULL AS REAL ) > ( - + 7 )
----

query I rowsort
SELECT 91 FROM tab2 GROUP BY col2
----
................................................................................
SELECT ALL - col1 AS col1 FROM tab1 AS cor0 WHERE NOT ( - col1 + + col2 ) NOT BETWEEN + col0 AND + col2 GROUP BY col2, col1
----

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + 53 * + 8 + col1 * + 13 - - COALESCE ( + 83, - col0, - col1 * + 59 ) AS col2 FROM tab0 GROUP BY col1, col1, col1 HAVING NOT NULL IS NOT NULL
----
1560
507

query I rowsort
................................................................................
SELECT ALL + ( + ( + COALESCE ( CAST( + 0 AS SIGNED ), + col1 ) ) ) - - 96 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
96
96
96

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8061
SELECT ALL + ( + ( + COALESCE ( CAST ( + 0 AS INTEGER ), + col1 ) ) ) - - 96 AS col1 FROM tab0 AS cor0 GROUP BY col2
----
96
96
96

................................................................................
query I rowsort
SELECT - ( 86 ) FROM tab0 GROUP BY col2, col1
----
-86
-86
-86

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

query I rowsort
SELECT 69 AS col2 FROM tab1 AS cor0 GROUP BY col0
----
................................................................................
-4203
91
-4250
92
-631
15

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - 72 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING - 49 NOT BETWEEN ( - 46 ) AND - + 47 + - + col2
----
-72
-72
-72

................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query III rowsort label-8342
SELECT ALL - + col0 col1, - col0 * - col0 * - col0 AS col1, + - 81 - 18 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING + CAST( + + 36 AS SIGNED ) IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort label-8342
SELECT ALL - + col0 col1, - col0 * - col0 * - col0 AS col1, + - 81 - 18 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING + CAST ( + + 36 AS INTEGER ) IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8343
SELECT - + col1 DIV + col1 + col1 col0 FROM tab2 AS cor0 GROUP BY col1
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8387
SELECT ALL col0, - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL = col0 + + col1 / + CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-8387
SELECT ALL col0, - col0 AS col1 FROM tab0 GROUP BY col0 HAVING NULL = col0 + + col1 / + CAST ( NULL AS INTEGER )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-8388
SELECT ALL - col0 + col0 AS col1, CAST( + 32 AS SIGNED ) col2 FROM tab1 cor0 GROUP BY col0
................................................................................
NULL
NULL

query I rowsort
SELECT NULLIF ( - 6, + + col0 ) AS col2 FROM tab2 AS cor0 WHERE 41 IS NULL GROUP BY col2, col0
----

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

query I rowsort
SELECT - ( col2 ) AS col2 FROM tab2 AS cor0 GROUP BY col2
----
................................................................................
query I rowsort
SELECT - 36 + + 65 FROM tab0 AS cor0 GROUP BY col0
----
29
29
29

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + 82 + - col1 + + - 6 - COALESCE ( + 79, 34 + - col2 ) AS col2 FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col1
----
-44
-62
-64

................................................................................
SELECT DISTINCT + col2 * + + CAST ( NULL AS INTEGER ) FROM tab2 GROUP BY col2, col1 HAVING NOT NULL IS NULL
----

query I rowsort
SELECT + col1 - + 53 / + 34 FROM tab1 WHERE NULL IS NULL GROUP BY col1 HAVING + 8 = NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col2, 46 + + col2 + + + col2 AS col0 FROM tab1 GROUP BY col2, col2
----
45
136
71
188
................................................................................
query I rowsort
SELECT ALL col0 FROM tab0 GROUP BY col0, col0, col2 HAVING NULL IS NULL
----
26
43
83

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + CASE - - 56 WHEN + 25 THEN + - col2 * + + 18 * + 96 + - ( + + 15 ) * col2 - + col2 * - col0 + + col0 END FROM tab1 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

................................................................................

query I rowsort
SELECT DISTINCT col1 + 83 FROM tab0 AS cor0 GROUP BY col1
----
164
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col1 col1, - 69 AS col1 FROM tab0 AS cor0 GROUP BY col1 HAVING ( - 79 ) = ( NULL )
----

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

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

query I rowsort
SELECT - ( - + col2 ) AS col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8761
SELECT CAST( NULL AS SIGNED ) AS col2 FROM tab0 GROUP BY col1 HAVING NOT ( col2 <= NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8761
SELECT CAST ( NULL AS INTEGER ) AS col2 FROM tab0 GROUP BY col1 HAVING NOT ( col2 <= NULL )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + CASE WHEN NOT NULL NOT BETWEEN NULL AND NULL THEN - col1 ELSE NULL END FROM tab2 GROUP BY col0
----
NULL
NULL
NULL

................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8764
SELECT DISTINCT - 9 + COALESCE ( + - 50, col1, col0 * CAST( NULL AS SIGNED ) ) FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
-59

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8764
SELECT DISTINCT - 9 + COALESCE ( + - 50, col1, col0 * CAST ( NULL AS INTEGER ) ) FROM tab1 WHERE NOT NULL IS NOT NULL GROUP BY col0, col0
----
-59

query I rowsort
SELECT + col2 AS col0 FROM tab0 GROUP BY col2 HAVING - + col2 BETWEEN ( NULL ) AND NULL
................................................................................
-22
22
-28
28
-82
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL ( + col1 ) AS col0, col1 AS col2 FROM tab0 AS cor0 WHERE NOT ( + ( + col0 ) ) IS NULL GROUP BY col1 HAVING ( NOT col2 * + 27 * + - 3 <> NULL )
----

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col0 * COALESCE ( 0, 77 * NULLIF ( + col0, - col0 ) + - 30, + col0, col1 * + 49 ) FROM tab1 WHERE NOT 27 * + - col1 IS NULL GROUP BY col0, col0 HAVING NOT + 81 IS NOT NULL
----

query I rowsort
SELECT DISTINCT - - 44 AS col2 FROM tab1 WHERE NULL < NULL GROUP BY col1, col0
----
................................................................................

skipif mysql # not compatible
query I rowsort label-8919
SELECT DISTINCT + 73 / 85 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL OR NOT NULL = NULL
----
0

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + 68 col2, + col0 FROM tab0 AS cor0 GROUP BY col0
----
68
26
68
43
................................................................................
NULL
43
NULL
84
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8953
SELECT DISTINCT + col2 + 5 + + col1 col0, 50 - - 34 * ( + CAST ( NULL AS INTEGER ) ) AS col1 FROM tab0 GROUP BY col2, col1
----
110
NULL
43
NULL
................................................................................
query I rowsort
SELECT ALL 38 * + col1 + + + 6 FROM tab2 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
1564
2248
2324

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col1 col0, col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL IS NOT NULL
----
-81
81
0
0
................................................................................
query I rowsort
SELECT - 98 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING - col2 <= + 36
----
-98
-98
-98

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL col1 AS col0, col1 FROM tab0 GROUP BY col1, col1 HAVING NOT NULL < col0
----

query I rowsort
SELECT col0 - col2 * + 71 FROM tab1 GROUP BY col2, col0 HAVING NOT - col0 > NULL
----
................................................................................
-2

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL col2 col0, 12 AS col1 FROM tab2 AS cor0 WHERE - col0 < NULL GROUP BY col2 HAVING NULL IS NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9155
SELECT ALL CAST( NULL AS SIGNED ) FROM tab1 GROUP BY col0
................................................................................
-83
-83

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - COALESCE ( - + 18, + - 49, + - col2 + - col2 * 99 ) * 70 FROM tab1 GROUP BY col0 HAVING + 33 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ( + 72 ) + - col1 col2 FROM tab0 GROUP BY col1
................................................................................
query I rowsort
SELECT + 81 FROM tab0 GROUP BY col0
----
81
81
81

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + - COALESCE ( - ( + 3 ), col0 ) - col1 * NULLIF ( col1, col1 - 24 ) AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT NULL <> ( NULL )
----

query I rowsort
SELECT ALL 37 AS col1 FROM tab0 GROUP BY col1, col2
----
................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9278
SELECT DISTINCT - - CASE WHEN NOT ( NULL ) BETWEEN ( + + 21 ) AND 42 * - CASE - col1 WHEN - col1 * - 20 * - col1 + - 83 THEN NULL ELSE - COALESCE ( CAST( NULL AS SIGNED ), + + 58 + 99 ) * + col1 END THEN + - 84 END AS col2 FROM tab1 cor0 GROUP BY col0
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-9278
SELECT DISTINCT - - CASE WHEN NOT ( NULL ) BETWEEN ( + + 21 ) AND 42 * - CASE - col1 WHEN - col1 * - 20 * - col1 + - 83 THEN NULL ELSE - COALESCE ( CAST ( NULL AS INTEGER ), + + 58 + 99 ) * + col1 END THEN + - 84 END AS col2 FROM tab1 cor0 GROUP BY col0
----
NULL

query I rowsort
SELECT + 2 * + - col1 + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1
................................................................................

query I rowsort
SELECT ALL + + 87 - 12 FROM tab0 AS cor0 GROUP BY col1
----
75
75

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 AS col0, + col0 * + 49 - col0 + + ( col0 ) * - col0 + - col0 col1 FROM tab2 AS cor0 GROUP BY col0
................................................................................
-5156
-78

query I rowsort
SELECT ALL - 22 + + col0 FROM tab2 AS cor0 WHERE + col0 * col0 IS NOT NULL GROUP BY col0 HAVING NOT NULL NOT IN ( col0 )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col1 * + - COALESCE ( + 48, + COALESCE ( 27, col2 ) ) + - 76 * ( - col1 + + col1 * col1 ) FROM tab1 AS cor0 GROUP BY col1
----
-141680
-1992
-239856

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( + 4, + + col0 * 32 ) FROM tab2 AS cor0 GROUP BY col2
----
-4
-4
-4

................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-9346
SELECT CAST( NULL AS SIGNED ) + col2 col1, - col2 - - + COALESCE ( 3, + NULLIF ( 47, + 66 / col0 ), - 79 ) AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT + CAST( + ( + 90 ) AS SIGNED ) >= ( NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-9346
SELECT CAST ( NULL AS INTEGER ) + col2 col1, - col2 - - + COALESCE ( 3, + NULLIF ( 47, + 66 / col0 ), - 79 ) AS col2 FROM tab0 AS cor0 GROUP BY col2, col2 HAVING NOT + CAST ( + ( + 90 ) AS INTEGER ) >= ( NULL )
----

query I rowsort
SELECT - col1 AS col2 FROM tab0 GROUP BY col1 HAVING NOT ( ( NULL IS NULL ) )
----
................................................................................
SELECT col0 - - + 61 DIV - - COALESCE ( - 35, + 83, - col2 ) FROM tab0 AS cor0 GROUP BY col0
----
25
42
82

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-9356
SELECT col0 - - + 61 / - - COALESCE ( - 35, + 83, - col2 ) FROM tab0 AS cor0 GROUP BY col0
----
25
42
82

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - - col0 + - ( + col0 ) + + - CASE WHEN ( + col0 ) < ( NULL ) THEN - col2 END + 97 / col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL NOT IN ( - col0 * + col0 )
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col0 col0, 90 + 62 + 53 + - + col0 * - col0 AS col2 FROM tab2 GROUP BY col0 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT - col2 FROM tab0 GROUP BY col1, col2, col1
----
................................................................................
query I rowsort
SELECT - 34 + - 62 FROM tab0 WHERE - + col1 IS NOT NULL GROUP BY col2, col1
----
-96
-96
-96

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col2 AS col0 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING COALESCE ( COALESCE ( + 24, col0 ), - - NULLIF ( - col1, + col2 ) * 51 + CASE + col0 - - 79 * col1 WHEN + ( - col2 ) THEN NULL ELSE - 5 * col2 END ) > NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9551
SELECT + 0 / col2 + + + ( CAST( NULL AS SIGNED ) ) * + col2 + - col2 FROM tab2 cor0 GROUP BY col2, col2
................................................................................
----

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - col2 AS col0 FROM tab1 AS cor0 GROUP BY col2 HAVING NOT ( ( NULL ) > - 11 * + - col0 + + ( + col0 ) )
----

query II rowsort
SELECT col0 * + + col0 AS col1, - col1 + col0 AS col1 FROM tab0 AS cor0 GROUP BY col1, col0, col1
----
................................................................................
query I rowsort label-9663
SELECT 41 + 71 - + + 40 * CAST ( NULL AS REAL ) FROM tab2 AS cor0 GROUP BY col2, col2
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - 2 col1, col0 AS col0 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NOT - 46 IS NULL
----
-2
15
-2
91
................................................................................
onlyif mysql # CAST syntax: SIGNED type: DIV for integer division: 
query III rowsort label-9684
SELECT col0 DIV - - 41 * - col0 col1, + col0 * + col0, - 3 * + CAST( NULL AS SIGNED ) AS col1 FROM tab2 cor0 GROUP BY col0
----
9 values hashing to 28d1a296c6990b10de76d21db8c99739

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort label-9684
SELECT col0 / - - 41 * - col0 col1, + col0 * + col0, - 3 * + CAST ( NULL AS INTEGER ) AS col1 FROM tab2 cor0 GROUP BY col0
----
9 values hashing to 28d1a296c6990b10de76d21db8c99739

query I rowsort
SELECT + 66 + - col1 FROM tab1 AS cor0 GROUP BY col0, col1 HAVING NULL <= - col1
................................................................................
-819
-828

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 col1, + col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
-15
15
-91
91
................................................................................
SELECT DISTINCT col0 + - 25 + + - col0 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----

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

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

query I rowsort
SELECT - 46 * + col1 FROM tab2 GROUP BY col1
----
................................................................................
0
81

query I rowsort
SELECT ALL - AVG ( DISTINCT 81 ) AS col2 FROM tab2 cor0 WHERE NOT - col2 * col2 <= + 17 GROUP BY col1 HAVING NOT - ( col1 ) IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + - ( ( + - col2 ) ) AS col1 FROM tab1 AS cor0 GROUP BY col2, col0 HAVING NOT + col1 <> NULL
----

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

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9925
SELECT + 45 * + CAST( 44 AS SIGNED ) * + COALESCE ( 13, - col1 ) + col2 FROM tab0 GROUP BY col2, col0, col2 HAVING ( - 39 + + col0 ) IS NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-9925
SELECT + 45 * + CAST ( 44 AS INTEGER ) * + COALESCE ( 13, - col1 ) + col2 FROM tab0 GROUP BY col2, col0, col2 HAVING ( - 39 + + col0 ) IS NULL
----

query I rowsort
SELECT DISTINCT - col0 + + col1 * + col1 AS col1 FROM tab1 GROUP BY col1, col0
----
................................................................................
91
92

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT col1, + col1 + 43 AS col0 FROM tab0 AS cor0 GROUP BY col1, col2 HAVING NULL BETWEEN ( col0 ) AND - + 68 * + + 41 - - 84 + + - col1
----

query I rowsort
SELECT DISTINCT 24 AS col0 FROM tab0 GROUP BY col0
----
................................................................................
137
43
56
26
56
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col2, 96 AS col0 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( col0 ) NOT BETWEEN - 73 AND NULL
----

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

Changes to test/random/groupby/slt_good_12.test.

32
33
34
35
36
37
38

39
40
41
42
43
44
45
...
433
434
435
436
437
438
439

440
441
442
443
444
445
446
....
2085
2086
2087
2088
2089
2090
2091

2092
2093
2094
2095
2096
2097
2098
....
2617
2618
2619
2620
2621
2622
2623

2624
2625
2626
2627
2628
2629
2630
....
2953
2954
2955
2956
2957
2958
2959

2960
2961
2962
2963
2964
2965
2966
....
3438
3439
3440
3441
3442
3443
3444

3445
3446
3447
3448
3449
3450
3451
....
4039
4040
4041
4042
4043
4044
4045

4046
4047
4048
4049
4050
4051
4052
....
5071
5072
5073
5074
5075
5076
5077

5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089

5090
5091
5092
5093
5094
5095
5096
....
5355
5356
5357
5358
5359
5360
5361

5362
5363
5364
5365
5366
5367
5368
5369
5370
5371

5372
5373
5374
5375
5376
5377
5378
....
5551
5552
5553
5554
5555
5556
5557

5558
5559
5560
5561
5562
5563
5564
....
5857
5858
5859
5860
5861
5862
5863

5864
5865
5866
5867
5868
5869
5870
....
6192
6193
6194
6195
6196
6197
6198

6199
6200
6201
6202
6203
6204
6205
....
6344
6345
6346
6347
6348
6349
6350

6351
6352
6353
6354
6355
6356
6357

6358
6359
6360
6361

6362
6363
6364
6365
6366
6367
6368
....
6626
6627
6628
6629
6630
6631
6632

6633
6634
6635
6636
6637
6638
6639
....
6781
6782
6783
6784
6785
6786
6787

6788
6789
6790
6791
6792
6793
6794
6795
6796
6797

6798
6799
6800
6801
6802
6803
6804
....
6962
6963
6964
6965
6966
6967
6968

6969
6970
6971
6972
6973
6974
6975
....
7285
7286
7287
7288
7289
7290
7291

7292
7293
7294
7295
7296
7297
7298
....
7643
7644
7645
7646
7647
7648
7649

7650
7651
7652
7653
7654
7655
7656
....
7659
7660
7661
7662
7663
7664
7665

7666
7667
7668
7669
7670
7671
7672
....
7811
7812
7813
7814
7815
7816
7817

7818
7819
7820
7821
7822
7823
7824
....
8100
8101
8102
8103
8104
8105
8106

8107
8108
8109
8110
8111
8112
8113
....
8140
8141
8142
8143
8144
8145
8146

8147
8148
8149
8150
8151
8152
8153
....
8395
8396
8397
8398
8399
8400
8401

8402
8403
8404
8405
8406
8407
8408
....
8732
8733
8734
8735
8736
8737
8738

8739
8740
8741
8742
8743
8744
8745
....
9545
9546
9547
9548
9549
9550
9551

9552
9553
9554
9555
9556
9557
9558
....
9585
9586
9587
9588
9589
9590
9591

9592
9593
9594
9595
9596
9597
9598
....
9663
9664
9665
9666
9667
9668
9669

9670
9671
9672
9673
9674
9675
9676
.....
10106
10107
10108
10109
10110
10111
10112

10113
10114
10115
10116
10117
10118
10119
.....
10752
10753
10754
10755
10756
10757
10758

10759
10760
10761
10762
10763
10764
10765
.....
10778
10779
10780
10781
10782
10783
10784

10785
10786
10787
10788
10789
10790
10791
.....
10844
10845
10846
10847
10848
10849
10850

10851
10852
10853
10854
10855
10856
10857
.....
10881
10882
10883
10884
10885
10886
10887

10888
10889
10890
10891
10892
10893
10894
.....
12798
12799
12800
12801
12802
12803
12804

12805
12806
12807
12808
12809
12810
12811
.....
12865
12866
12867
12868
12869
12870
12871

12872
12873
12874
12875
12876
12877
12878
.....
13344
13345
13346
13347
13348
13349
13350

13351
13352
13353
13354
13355
13356
13357
.....
13662
13663
13664
13665
13666
13667
13668

13669
13670
13671
13672
13673
13674
13675
.....
13865
13866
13867
13868
13869
13870
13871

13872
13873
13874
13875
13876
13877
13878
.....
13974
13975
13976
13977
13978
13979
13980

13981
13982
13983
13984
13985
13986
13987
.....
14028
14029
14030
14031
14032
14033
14034

14035
14036
14037
14038
14039
14040
14041

14042
14043
14044
14045
14046
14047
14048
.....
14268
14269
14270
14271
14272
14273
14274

14275
14276
14277
14278
14279
14280
14281
.....
14519
14520
14521
14522
14523
14524
14525

14526
14527
14528
14529
14530
14531
14532
.....
14928
14929
14930
14931
14932
14933
14934

14935
14936
14937
14938
14939
14940
14941
14942
14943
14944

14945
14946
14947
14948
14949
14950
14951
.....
15421
15422
15423
15424
15425
15426
15427

15428
15429
15430
15431
15432
15433
15434
.....
15514
15515
15516
15517
15518
15519
15520

15521
15522
15523
15524
15525
15526
15527
.....
15564
15565
15566
15567
15568
15569
15570

15571
15572
15573
15574
15575
15576
15577
.....
16242
16243
16244
16245
16246
16247
16248

16249
16250
16251
16252
16253
16254
16255
.....
16278
16279
16280
16281
16282
16283
16284

16285
16286
16287
16288
16289
16290
16291
.....
16574
16575
16576
16577
16578
16579
16580

16581
16582
16583
16584
16585
16586
16587
.....
16639
16640
16641
16642
16643
16644
16645

16646
16647
16648
16649
16650
16651
16652
.....
18054
18055
18056
18057
18058
18059
18060

18061
18062
18063
18064
18065
18066
18067
.....
18549
18550
18551
18552
18553
18554
18555

18556
18557
18558
18559
18560
18561
18562
.....
18805
18806
18807
18808
18809
18810
18811

18812
18813
18814
18815
18816
18817
18818
.....
18823
18824
18825
18826
18827
18828
18829

18830
18831
18832
18833
18834
18835
18836
.....
18901
18902
18903
18904
18905
18906
18907

18908
18909
18910
18911
18912
18913
18914
.....
19070
19071
19072
19073
19074
19075
19076

19077
19078
19079
19080
19081
19082
19083
.....
19529
19530
19531
19532
19533
19534
19535

19536
19537
19538
19539
19540
19541
19542
.....
19844
19845
19846
19847
19848
19849
19850

19851
19852
19853
19854
19855
19856
19857
.....
20737
20738
20739
20740
20741
20742
20743

20744
20745
20746
20747
20748
20749
20750
.....
21030
21031
21032
21033
21034
21035
21036

21037
21038
21039
21040
21041
21042
21043
.....
21490
21491
21492
21493
21494
21495
21496

21497
21498
21499
21500
21501
21502
21503
.....
21712
21713
21714
21715
21716
21717
21718

21719
21720
21721
21722
21723
21724
21725
.....
21752
21753
21754
21755
21756
21757
21758

21759
21760
21761
21762
21763
21764
21765
.....
22156
22157
22158
22159
22160
22161
22162

22163
22164
22165
22166
22167
22168
22169
.....
22307
22308
22309
22310
22311
22312
22313

22314
22315
22316
22317
22318
22319
22320
.....
22519
22520
22521
22522
22523
22524
22525

22526
22527
22528
22529
22530
22531
22532
.....
22966
22967
22968
22969
22970
22971
22972

22973
22974
22975
22976
22977
22978
22979
.....
23188
23189
23190
23191
23192
23193
23194

23195
23196
23197
23198
23199
23200
23201
.....
23754
23755
23756
23757
23758
23759
23760

23761
23762
23763
23764
23765
23766
23767
.....
23812
23813
23814
23815
23816
23817
23818

23819
23820
23821
23822
23823
23824
23825
.....
24659
24660
24661
24662
24663
24664
24665

24666
24667
24668
24669
24670
24671
24672
.....
24801
24802
24803
24804
24805
24806
24807

24808
24809
24810
24811
24812
24813
24814
.....
25323
25324
25325
25326
25327
25328
25329

25330
25331
25332
25333
25334
25335
25336
.....
25916
25917
25918
25919
25920
25921
25922

25923
25924
25925
25926
25927
25928
25929
.....
26238
26239
26240
26241
26242
26243
26244

26245
26246
26247
26248
26249
26250
26251
.....
26855
26856
26857
26858
26859
26860
26861

26862
26863
26864
26865
26866
26867
26868
.....
27523
27524
27525
27526
27527
27528
27529

27530
27531
27532
27533
27534
27535
27536
.....
27745
27746
27747
27748
27749
27750
27751

27752
27753
27754
27755
27756
27757
27758
.....
29067
29068
29069
29070
29071
29072
29073

29074
29075
29076
29077
29078
29079
29080
.....
29484
29485
29486
29487
29488
29489
29490

29491
29492
29493
29494
29495
29496
29497
.....
29694
29695
29696
29697
29698
29699
29700

29701
29702
29703
29704
29705
29706
29707
.....
30405
30406
30407
30408
30409
30410
30411

30412
30413
30414
30415
30416
30417
30418
.....
31721
31722
31723
31724
31725
31726
31727

31728
31729
31730
31731
31732
31733
31734
.....
32002
32003
32004
32005
32006
32007
32008

32009
32010
32011
32012
32013
32014
32015
.....
32491
32492
32493
32494
32495
32496
32497

32498
32499
32500
32501
32502
32503
32504
.....
32894
32895
32896
32897
32898
32899
32900

32901
32902
32903
32904
32905
32906
32907
.....
32969
32970
32971
32972
32973
32974
32975

32976
32977
32978
32979
32980
32981
32982
.....
33065
33066
33067
33068
33069
33070
33071

33072
33073
33074
33075
33076
33077
33078
.....
33164
33165
33166
33167
33168
33169
33170

33171
33172
33173
33174
33175
33176
33177
.....
33302
33303
33304
33305
33306
33307
33308

33309
33310
33311
33312
33313
33314
33315
.....
33553
33554
33555
33556
33557
33558
33559

33560
33561
33562
33563
33564
33565
33566
.....
33865
33866
33867
33868
33869
33870
33871

33872
33873
33874
33875
33876
33877
33878
.....
34500
34501
34502
34503
34504
34505
34506

34507
34508
34509
34510
34511
34512
34513
.....
35513
35514
35515
35516
35517
35518
35519

35520
35521
35522
35523
35524
35525
35526
.....
35711
35712
35713
35714
35715
35716
35717

35718
35719
35720
35721
35722
35723
35724
.....
35871
35872
35873
35874
35875
35876
35877

35878
35879
35880
35881
35882
35883
35884
.....
35933
35934
35935
35936
35937
35938
35939

35940
35941
35942
35943
35944
35945
35946
.....
36225
36226
36227
36228
36229
36230
36231

36232
36233
36234
36235
36236
36237
36238
.....
36787
36788
36789
36790
36791
36792
36793

36794
36795
36796
36797
36798
36799
36800
.....
37318
37319
37320
37321
37322
37323
37324

37325
37326
37327
37328
37329
37330
37331
.....
37782
37783
37784
37785
37786
37787
37788

37789
37790
37791
37792
37793
37794
37795
.....
37812
37813
37814
37815
37816
37817
37818

37819
37820
37821
37822
37823
37824
37825
.....
38031
38032
38033
38034
38035
38036
38037

38038
38039
38040
38041
38042
38043
38044
.....
38074
38075
38076
38077
38078
38079
38080

38081
38082
38083
38084
38085
38086
38087
.....
38734
38735
38736
38737
38738
38739
38740

38741
38742
38743
38744
38745
38746
38747
.....
38903
38904
38905
38906
38907
38908
38909

38910
38911
38912
38913
38914
38915
38916
.....
39000
39001
39002
39003
39004
39005
39006

39007
39008
39009
39010
39011
39012
39013
.....
39900
39901
39902
39903
39904
39905
39906

39907
39908
39909
39910
39911
39912
39913
.....
40460
40461
40462
40463
40464
40465
40466

40467
40468
40469
40470
40471
40472
40473
.....
40718
40719
40720
40721
40722
40723
40724

40725
40726
40727
40728
40729
40730
40731
.....
40760
40761
40762
40763
40764
40765
40766

40767
40768
40769
40770
40771
40772
40773
.....
41335
41336
41337
41338
41339
41340
41341

41342
41343
41344
41345
41346
41347
41348
.....
41361
41362
41363
41364
41365
41366
41367

41368
41369
41370
41371
41372
41373
41374
.....
42052
42053
42054
42055
42056
42057
42058

42059
42060
42061
42062
42063
42064
42065
.....
43086
43087
43088
43089
43090
43091
43092

43093
43094
43095
43096
43097
43098
43099
.....
43300
43301
43302
43303
43304
43305
43306

43307
43308
43309
43310
43311
43312
43313
.....
44198
44199
44200
44201
44202
44203
44204

44205
44206
44207
44208
44209
44210
44211
.....
44215
44216
44217
44218
44219
44220
44221

44222
44223
44224
44225
44226
44227
44228
.....
44627
44628
44629
44630
44631
44632
44633

44634
44635
44636
44637
44638
44639
44640
.....
44937
44938
44939
44940
44941
44942
44943

44944
44945
44946
44947
44948
44949
44950
.....
44976
44977
44978
44979
44980
44981
44982

44983
44984
44985
44986
44987
44988
44989
.....
45188
45189
45190
45191
45192
45193
45194

45195
45196
45197
45198
45199
45200
45201
45202
45203
45204

45205
45206
45207
45208
45209
45210
45211
.....
45259
45260
45261
45262
45263
45264
45265

45266
45267
45268
45269
45270
45271
45272
.....
45631
45632
45633
45634
45635
45636
45637

45638
45639
45640
45641
45642
45643
45644

45645
45646
45647
45648
45649
45650
45651
.....
45840
45841
45842
45843
45844
45845
45846

45847
45848
45849
45850
45851
45852
45853
.....
46120
46121
46122
46123
46124
46125
46126

46127
46128
46129
46130
46131
46132
46133
.....
46486
46487
46488
46489
46490
46491
46492

46493
46494
46495
46496
46497
46498
46499
.....
46565
46566
46567
46568
46569
46570
46571

46572
46573
46574
46575
46576
46577
46578
.....
47193
47194
47195
47196
47197
47198
47199

47200
47201
47202
47203
47204
47205
47206
.....
48365
48366
48367
48368
48369
48370
48371

48372
48373
48374
48375
48376
48377
48378
.....
48492
48493
48494
48495
48496
48497
48498

48499
48500
48501
48502
48503
48504
48505
.....
48727
48728
48729
48730
48731
48732
48733

48734
48735
48736
48737
48738
48739
48740
.....
48809
48810
48811
48812
48813
48814
48815

48816
48817
48818
48819
48820
48821
48822
.....
48871
48872
48873
48874
48875
48876
48877

48878
48879
48880
48881
48882
48883
48884
.....
48965
48966
48967
48968
48969
48970
48971

48972
48973
48974
48975
48976
48977
48978
.....
49104
49105
49106
49107
49108
49109
49110

49111
49112
49113
49114
49115
49116
49117
.....
49150
49151
49152
49153
49154
49155
49156

49157
49158
49159
49160
49161
49162
49163
.....
49479
49480
49481
49482
49483
49484
49485

49486
49487
49488
49489
49490
49491
49492
.....
49621
49622
49623
49624
49625
49626
49627

49628
49629
49630
49631
49632
49633
49634
.....
49689
49690
49691
49692
49693
49694
49695

49696
49697
49698
49699
49700
49701
49702
.....
50336
50337
50338
50339
50340
50341
50342

50343
50344
50345
50346
50347
50348
50349
.....
50376
50377
50378
50379
50380
50381
50382

50383
50384
50385
50386
50387
50388
50389
.....
50507
50508
50509
50510
50511
50512
50513

50514
50515
50516
50517
50518
50519
50520
.....
50642
50643
50644
50645
50646
50647
50648

50649
50650
50651
50652
50653
50654
50655
.....
50677
50678
50679
50680
50681
50682
50683

50684
50685
50686
50687
50688
50689
50690
.....
50838
50839
50840
50841
50842
50843
50844

50845
50846
50847
50848
50849
50850
50851
50852
50853
50854

50855
50856
50857
50858
50859
50860
50861
.....
51426
51427
51428
51429
51430
51431
51432

51433
51434
51435
51436
51437
51438
51439
.....
51486
51487
51488
51489
51490
51491
51492

51493
51494
51495
51496
51497
51498
51499
.....
52634
52635
52636
52637
52638
52639
52640

52641
52642
52643
52644
52645
52646
52647
.....
53182
53183
53184
53185
53186
53187
53188

53189
53190
53191
53192
53193
53194
53195
53196
53197
53198
53199
53200
53201

53202
53203
53204
53205
53206
53207
53208
.....
53443
53444
53445
53446
53447
53448
53449

53450
53451
53452
53453
53454
53455
53456
.....
53591
53592
53593
53594
53595
53596
53597

53598
53599
53600
53601
53602
53603
53604
.....
53630
53631
53632
53633
53634
53635
53636

53637
53638
53639
53640
53641
53642
53643
.....
53990
53991
53992
53993
53994
53995
53996

53997
53998
53999
54000
54001
54002
54003
.....
54112
54113
54114
54115
54116
54117
54118

54119
54120
54121
54122
54123
54124
54125
.....
54793
54794
54795
54796
54797
54798
54799

54800
54801
54802
54803
54804
54805
54806
.....
54976
54977
54978
54979
54980
54981
54982

54983
54984
54985
54986
54987
54988
54989
.....
55439
55440
55441
55442
55443
55444
55445

55446
55447
55448
55449
55450
55451
55452
.....
56016
56017
56018
56019
56020
56021
56022

56023
56024
56025
56026
56027
56028
56029
.....
56244
56245
56246
56247
56248
56249
56250

56251
56252
56253
56254
56255
56256
56257
.....
56303
56304
56305
56306
56307
56308
56309

56310
56311
56312
56313
56314
56315
56316
.....
56594
56595
56596
56597
56598
56599
56600

56601
56602
56603
56604
56605
56606
56607
.....
56654
56655
56656
56657
56658
56659
56660

56661
56662
56663
56664
56665
56666
56667
.....
57174
57175
57176
57177
57178
57179
57180

57181
57182
57183
57184
57185
57186
57187
.....
57650
57651
57652
57653
57654
57655
57656

57657
57658
57659
57660
57661
57662
57663
.....
58574
58575
58576
58577
58578
58579
58580

58581
58582
58583
58584
58585
58586
58587
.....
58848
58849
58850
58851
58852
58853
58854

58855
58856
58857
58858
58859
58860
58861
.....
59015
59016
59017
59018
59019
59020
59021

59022
59023
59024
59025
59026
59027
59028
.....
59198
59199
59200
59201
59202
59203
59204

59205
59206
59207
59208
59209
59210
59211
.....
60049
60050
60051
60052
60053
60054
60055

60056
60057
60058
60059
60060
60061
60062
.....
60371
60372
60373
60374
60375
60376
60377

60378
60379
60380
60381
60382
60383
60384
.....
61452
61453
61454
61455
61456
61457
61458

61459
61460
61461
61462
61463
61464
61465
.....
61906
61907
61908
61909
61910
61911
61912

61913
61914
61915
61916
61917
61918
61919
.....
61953
61954
61955
61956
61957
61958
61959

61960
61961
61962
61963
61964
61965
61966
.....
62720
62721
62722
62723
62724
62725
62726

62727
62728
62729
62730
62731
62732
62733
.....
62833
62834
62835
62836
62837
62838
62839

62840
62841
62842
62843
62844
62845
62846
.....
63384
63385
63386
63387
63388
63389
63390

63391
63392
63393
63394
63395
63396
63397
.....
63864
63865
63866
63867
63868
63869
63870

63871
63872
63873
63874
63875
63876
63877
.....
64175
64176
64177
64178
64179
64180
64181

64182
64183
64184
64185
64186
64187
64188
.....
64478
64479
64480
64481
64482
64483
64484

64485
64486
64487
64488
64489
64490
64491
.....
64726
64727
64728
64729
64730
64731
64732

64733
64734
64735
64736
64737
64738
64739
64740
64741
64742
64743
64744
64745

64746
64747
64748
64749
64750
64751
64752
.....
64832
64833
64834
64835
64836
64837
64838

64839
64840
64841
64842
64843
64844
64845
.....
66280
66281
66282
66283
66284
66285
66286

66287
66288
66289
66290
66291
66292
66293
.....
66721
66722
66723
66724
66725
66726
66727

66728
66729
66730
66731
66732
66733
66734
.....
67418
67419
67420
67421
67422
67423
67424

67425
67426
67427
67428
67429
67430
67431
.....
67658
67659
67660
67661
67662
67663
67664

67665
67666
67667
67668
67669
67670
67671
.....
68704
68705
68706
68707
68708
68709
68710

68711
68712
68713
68714
68715
68716
68717
.....
68780
68781
68782
68783
68784
68785
68786

68787
68788
68789
68790
68791
68792
68793
.....
69324
69325
69326
69327
69328
69329
69330

69331
69332
69333
69334
69335
69336
69337
.....
69528
69529
69530
69531
69532
69533
69534

69535
69536
69537
69538
69539
69540
69541
.....
70016
70017
70018
70019
70020
70021
70022

70023
70024
70025
70026
70027
70028
70029
.....
70133
70134
70135
70136
70137
70138
70139

70140
70141
70142
70143
70144
70145
70146
.....
70361
70362
70363
70364
70365
70366
70367

70368
70369
70370
70371
70372
70373
70374
.....
70672
70673
70674
70675
70676
70677
70678

70679
70680
70681
70682
70683
70684
70685
.....
70978
70979
70980
70981
70982
70983
70984

70985
70986
70987
70988
70989
70990
70991
.....
71164
71165
71166
71167
71168
71169
71170

71171
71172
71173
71174
71175
71176
71177
.....
71302
71303
71304
71305
71306
71307
71308

71309
71310
71311
71312
71313
71314
71315
.....
71920
71921
71922
71923
71924
71925
71926

71927
71928
71929
71930
71931
71932
71933
.....
72214
72215
72216
72217
72218
72219
72220

72221
72222
72223
72224
72225
72226
72227
.....
72599
72600
72601
72602
72603
72604
72605

72606
72607
72608
72609
72610
72611
72612
.....
72757
72758
72759
72760
72761
72762
72763

72764
72765
72766
72767
72768
72769
72770
.....
77235
77236
77237
77238
77239
77240
77241

77242
77243
77244
77245
77246
77247
77248
.....
78566
78567
78568
78569
78570
78571
78572

78573
78574
78575
78576
78577
78578
78579

statement ok
INSERT INTO tab2 VALUES(91,59,79)

statement ok
INSERT INTO tab2 VALUES(92,41,58)


query I rowsort
SELECT DISTINCT CASE + col2 WHEN 61 THEN NULL ELSE + col2 * - + 95 * + 29 END col1 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) > NULL
----

query I rowsort
SELECT DISTINCT + col1 - + ( col1 ) FROM tab2 GROUP BY col1
----
................................................................................
query I rowsort
SELECT NULLIF ( col2, - col2 ) AS col2 FROM tab0 GROUP BY col2, col2, col0
----
24
38
79


query II rowsort
SELECT ALL + col2 + - + ( - 41 ) - - - col1 col1, 7 FROM tab1 cor0 GROUP BY col2, col1
----
29
7
43
7
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-281
SELECT ALL - 29 * - + 95 AS col1 FROM tab0 GROUP BY col0 HAVING + CAST( NULL AS SIGNED ) / ( + 17 ) = - + ( ( - + col1 ) )
----

skipif mysql # not compatible

query I rowsort label-281
SELECT ALL - 29 * - + 95 AS col1 FROM tab0 GROUP BY col0 HAVING + CAST ( NULL AS INTEGER ) / ( + 17 ) = - + ( ( - + col1 ) )
----

query I rowsort
SELECT + 49 FROM tab2 AS cor0 GROUP BY col2
----
................................................................................
-1403
-943

query I rowsort
SELECT ALL - + 88 + + CASE + col2 WHEN + 75 THEN + col2 END FROM tab0 AS cor0 GROUP BY col2, col2 HAVING ( NULL ) IS NOT NULL
----


query I rowsort
SELECT DISTINCT 79 AS col2 FROM tab2 WHERE NULL BETWEEN ( + col1 ) AND col0 GROUP BY col1 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT DISTINCT 48 / col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT col0 NOT BETWEEN + col0 * 96 AND ( NULL )
----
................................................................................
1540
-44
1995
-57
210
-6


query II rowsort
SELECT - col0 col1, + 92 + + + col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
-15
107
-91
183
................................................................................
query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT 47 IS NULL
----
44
57
6


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

query I rowsort
SELECT DISTINCT col1 FROM tab2 WHERE NOT ( NULL ) <= col1 GROUP BY col1 HAVING NOT AVG ( + col1 ) IS NULL
----
................................................................................
query I rowsort
SELECT - ( + col0 ) * + - 60 - - + col0 FROM tab2 cor0 GROUP BY col0
----
5551
5612
915


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

query I rowsort
SELECT + col2 * + col2 FROM tab1 cor0 GROUP BY col0, col2
----
................................................................................
----

skipif mysql # not compatible
query I rowsort label-684
SELECT - CAST ( 23 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) > ( NULL )
----


query I rowsort
SELECT 81 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) < 65 / col0 * 39
----

query I rowsort
SELECT ALL - 71 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING ( + - 18 + - 34 ) > ( NULL )
----

query I rowsort
SELECT ALL - ( col2 ) AS col0 FROM tab0 AS cor0 WHERE NOT ( col0 * - COALESCE ( col2, + - 75, 11 * col0 ) * col1 + + 58 ) NOT BETWEEN - ( - 33 ) + 99 AND col2 GROUP BY col1, col2
----


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

onlyif mysql # DIV for integer division: 
query I rowsort label-689
SELECT col1 - + + 42 DIV - 42 - - col1 col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING ( - col1 ) IS NOT NULL
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-728
SELECT DISTINCT + 86 * 64 AS col0 FROM tab1 GROUP BY col1 HAVING col0 - + CAST( NULL AS SIGNED ) >= NULL
----

skipif mysql # not compatible

query I rowsort label-728
SELECT DISTINCT + 86 * 64 AS col0 FROM tab1 GROUP BY col1 HAVING col0 - + CAST ( NULL AS INTEGER ) >= NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-729
SELECT DISTINCT + + AVG ( - ( col0 ) ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( col2 ) >= + CAST( NULL AS DECIMAL )
----

skipif mysql # not compatible

query I rowsort label-729
SELECT DISTINCT + + AVG ( - ( col0 ) ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( col2 ) >= + CAST ( NULL AS REAL )
----

query I rowsort
SELECT - 58 * col1 FROM tab1 GROUP BY col1
----
................................................................................
----

query I rowsort
SELECT DISTINCT - 79 FROM tab1 GROUP BY col2
----
-79


query I rowsort
SELECT - col0 AS col2 FROM tab2 cor0 GROUP BY col0 HAVING + NULLIF ( col2, + + 58 ) >= NULL
----

query I rowsort
SELECT DISTINCT - ( - 30 ) + col1 FROM tab1 AS cor0 GROUP BY col1
----
................................................................................
query I rowsort label-793
SELECT DISTINCT - 91 / + + col2 - col1 FROM tab0 GROUP BY col2, col1
----
-1
-2
-84


query II rowsort
SELECT - col0 col1, col0 FROM tab0 GROUP BY col0, col0
----
-26
26
-43
43
................................................................................
query I rowsort
SELECT ALL - 21 - + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-27
-65
-78


query II rowsort
SELECT ALL - 70 AS col0, 2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING - ( - - col0 ) <= NULL
----

query I rowsort
SELECT + ( - col1 ) FROM tab1 GROUP BY col1
----
................................................................................
----
53

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


query I rowsort
SELECT ALL + col1 * - col0 * CASE WHEN NULL = + col2 THEN NULL ELSE col0 END + + col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-149688
0
0


query I rowsort
SELECT DISTINCT + COALESCE ( 37, col2 / + col1 ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING ( + col0 ) * - - 4 >= NULL
----


query II rowsort
SELECT 9 * col2 + col2 + 30 * - col0 col1, col0 + - 1 * + 0 * - ( - col0 ) AS col0 FROM tab1 cor0 GROUP BY col0, col2
----
-1750
82
-390
28
................................................................................
query I rowsort
SELECT ALL - ( - col2 ) FROM tab0 GROUP BY col2
----
24
38
79


query II rowsort
SELECT + - 17 * + - 64 col0, + 49 AS col2 FROM tab2 cor0 GROUP BY col1
----
1088
49
1088
49
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-916
SELECT - - 92 * + + CAST( NULL AS SIGNED ) AS col1, ( - - 48 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING - col0 <= NULL
----

skipif mysql # not compatible

query II rowsort label-916
SELECT - - 92 * + + CAST ( NULL AS INTEGER ) AS col1, ( - - 48 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING - col0 <= NULL
----

query I rowsort
SELECT - 7 FROM tab0 GROUP BY col1
----
-7
-7


query I rowsort
SELECT DISTINCT col1 * - + col1 * + COALESCE ( + - 17, - COALESCE ( - col0, + + col0 * col2 + + + col2 ), - col2 ) - col1 AS col1 FROM tab1 GROUP BY col1, col1 HAVING NULL > NULL
----

query I rowsort
SELECT ALL 43 * + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----
................................................................................
query I rowsort
SELECT + 43 * - col0 + + 68 col0 FROM tab0 AS cor0 GROUP BY col0
----
-1050
-1781
-3501


query II rowsort
SELECT col1 col0, col1 + 87 AS col2 FROM tab0 GROUP BY col1, col1 HAVING NULL <> NULL
----

query I rowsort
SELECT - + 2 AS col1 FROM tab2 WHERE NULL >= NULL GROUP BY col2
----
................................................................................
-1
-8

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


query II rowsort
SELECT DISTINCT - + col0 + + col0 col1, col0 AS col2 FROM tab0 cor0 GROUP BY col0, col0
----
0
26
0
43
................................................................................
onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1034
SELECT DISTINCT - col2 + + col0 + + + NULLIF ( + CAST( NULL AS DECIMAL ), + col0 + - col1 ) FROM tab2 cor0 GROUP BY col0, col2
----
NULL

skipif mysql # not compatible

query I rowsort label-1034
SELECT DISTINCT - col2 + + col0 + + + NULLIF ( + CAST ( NULL AS REAL ), + col0 + - col1 ) FROM tab2 cor0 GROUP BY col0, col2
----
NULL

query I rowsort
SELECT + col1 - 26 FROM tab2 GROUP BY col1, col0 HAVING NULL BETWEEN + CASE - 99 WHEN - - col1 THEN NULL ELSE + 56 END AND 35 * - 64
................................................................................
query I rowsort
SELECT ALL 85 FROM tab0 GROUP BY col0, col0
----
85
85
85


query I rowsort
SELECT ALL col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING ( NOT NULL < - col1 * 9 )
----

query I rowsort
SELECT - 36 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
................................................................................
query I rowsort
SELECT DISTINCT - col0 + - 54 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2, col0
----
-137
-80
-97


query I rowsort
SELECT DISTINCT - COALESCE ( - 30, + col0 ) - 2 FROM tab0 cor0 GROUP BY col2
----
28

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 WHERE ( - 94 ) < col2 GROUP BY col1
................................................................................
-7505
-8265

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


query I rowsort
SELECT DISTINCT col1 * col1 AS col2 FROM tab0 WHERE NOT ( NULL ) IS NULL GROUP BY col1 HAVING NULL >= col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1099
SELECT DISTINCT CAST( NULL AS SIGNED ) col0 FROM tab1 GROUP BY col2
................................................................................
----

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


query II rowsort
SELECT - col1 col2, col1 AS col1 FROM tab2 AS cor0 GROUP BY col1
----
-41
41
-59
59
................................................................................
query I rowsort
SELECT col0 + - + col0 AS col2 FROM tab0 GROUP BY col0
----
0
0
0


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

query I rowsort
SELECT ALL + - 85 FROM tab1 AS cor0 GROUP BY col0, col2
----
................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1184
SELECT DISTINCT + - NULLIF ( - CAST( NULL AS SIGNED ), - 74 * + NULLIF ( - - col2, ( - col2 ) ) / + col0 ) FROM tab1 AS cor0 GROUP BY col1, col0
----
NULL

skipif mysql # not compatible

query I rowsort label-1184
SELECT DISTINCT + - NULLIF ( - CAST ( NULL AS INTEGER ), - 74 * + NULLIF ( - - col2, ( - col2 ) ) / + col0 ) FROM tab1 AS cor0 GROUP BY col1, col0
----
NULL

query I rowsort
SELECT DISTINCT 85 FROM tab0 GROUP BY col1, col0
................................................................................
SELECT - 57 + - col2 - + COALESCE ( + 83, + col1 ) + col2 + - CAST( NULL AS SIGNED ) * + 18 * + col2 - - + ( - ( - 90 ) ) FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible

query I rowsort label-1295
SELECT - 57 + - col2 - + COALESCE ( + 83, + col1 ) + col2 + - CAST ( NULL AS INTEGER ) * + 18 * + col2 - - + ( - ( - 90 ) ) FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

................................................................................
NULL
NULL

query II rowsort
SELECT ALL + 56 AS col0, 51 * col1 FROM tab0 GROUP BY col1 HAVING NOT + 30 * + 69 > NULL
----


query II rowsort
SELECT + 50 col2, + col0 * + + 69 * - + col0 * ( + + col0 ) FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT 26 * + col2 + - col2 + + - col2 AS col0 FROM tab2 cor0 GROUP BY col2 HAVING ( ( NULL > NULL ) )
----
................................................................................
query I rowsort
SELECT 15 AS col0 FROM tab2 GROUP BY col2
----
15
15
15


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

query I rowsort
SELECT DISTINCT - 22 * + 29 AS col1 FROM tab0 GROUP BY col1
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1375
SELECT DISTINCT + col0 * - col0 - - col0 * - col0 AS col1 FROM tab2 AS cor0 WHERE NOT - CAST( + col0 AS SIGNED ) <> - col1 / + col2 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND + CAST( NULL AS SIGNED ) - col1 / - col0
----

skipif mysql # not compatible

query I rowsort label-1375
SELECT DISTINCT + col0 * - col0 - - col0 * - col0 AS col1 FROM tab2 AS cor0 WHERE NOT - CAST ( + col0 AS INTEGER ) <> - col1 / + col2 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND + CAST ( NULL AS INTEGER ) - col1 / - col0
----

query I rowsort
SELECT DISTINCT - 53 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
................................................................................
30
30

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


query I rowsort
SELECT col2 AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING - col2 * + col2 + - col0 + + 39 - - + 32 <= NULL
----

query II rowsort
SELECT ALL 91 AS col2, + col0 + + 83 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
................................................................................
0
NULL
0
NULL
0

skipif mysql # not compatible

query II rowsort label-1468
SELECT ALL + 47 + - CAST ( NULL AS INTEGER ) col2, + col0 - col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
0
NULL
0
................................................................................
query I rowsort
SELECT ALL + 82 + - col1 FROM tab2 GROUP BY col1
----
21
23
41


query II rowsort
SELECT 64 * - col0 col1, - ( - - col0 ) AS col0 FROM tab1 GROUP BY col0, col0
----
-1408
-22
-1792
-28
................................................................................
NULL
NULL

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


query I rowsort
SELECT 40 AS col0 FROM tab1 GROUP BY col1 HAVING ( NULL ) < - col0
----

query I rowsort
SELECT 63 FROM tab1 AS cor0 GROUP BY col0
----
................................................................................
SELECT col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT 71 <> NULL
----

query I rowsort
SELECT ALL 77 * + 26 AS col1 FROM tab2 GROUP BY col0 HAVING ( NULL ) >= col0 * 57
----


query I rowsort
SELECT col2 * - - COALESCE ( - 89, col1 * NULLIF ( ( 97 ), + col2 * - col2 ), - col2 + col1 ) AS col1 FROM tab0 GROUP BY col2
----
-2136
-3382
-7031

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


query II rowsort
SELECT col0 * + col0 - + col0 + + col0 + - 14 + col0 col0, col0 FROM tab1 AS cor0 GROUP BY col0
----
492
22
6792
82
................................................................................
query I rowsort
SELECT ALL - col0 FROM tab1 cor0 GROUP BY col0 HAVING - + 91 IS NOT NULL
----
-22
-28
-82


query II rowsort
SELECT DISTINCT - col2 / + 34 * - 30 + + 38 AS col0, - 43 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL < 69 * col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-1821
SELECT DISTINCT - CASE + - col2 WHEN ( - CAST( NULL AS SIGNED ) ) + - - 76 + + - 56 THEN 53 END AS col2, + col0 FROM tab2 GROUP BY col2, col0
................................................................................
query I rowsort
SELECT ALL 39 FROM tab0 GROUP BY col0, col0
----
39
39
39


query II rowsort
SELECT ALL 29 col2, - col0 * + 72 + - 77 * + col0 - - + col2 AS col2 FROM tab1 GROUP BY col0, col2 HAVING NOT NULL IS NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-1866
SELECT DISTINCT + - col2 DIV col1 FROM tab1 AS cor0 GROUP BY col2, col1, col0
................................................................................
SELECT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

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


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

query I rowsort
SELECT ALL + 58 * 8 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----
................................................................................
6605

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


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

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

query I rowsort
SELECT DISTINCT 95 * - ( - 56 ) * + ( - + 69 ) FROM tab0 AS cor0 GROUP BY col1
----
-367080


query I rowsort
SELECT ALL ( - COALESCE ( + 57, - col0 * 81 * col1 ) ) FROM tab1 GROUP BY col1
----
-57
-57
-57


query I rowsort
SELECT + + col1 - col1 * COALESCE ( - + 86, - + col0 * - + col1 + col2, col2 ) - 55 * + - 11 AS col1 FROM tab2 AS cor0 WHERE col1 NOT BETWEEN NULL AND NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col0 + - + col0 NOT BETWEEN NULL AND NULL
................................................................................
query I rowsort label-1946
SELECT + col1 * 89 - col1 + col1 / - - col0 - 42 FROM tab1 AS cor0 GROUP BY col0, col1
----
3830
486
4976


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

query I rowsort
SELECT ALL 9 * - col2 AS col1 FROM tab0 GROUP BY col2
----
................................................................................
SELECT ALL col0 AS col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 GROUP BY col2, col1, col2 HAVING 32 + ( col2 ) >= NULL
----


query II rowsort
SELECT ALL + + 8 col0, col1 + 8 * 91 + + 57 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT 63 * - col1 * + col1 >= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1988
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL NOT BETWEEN + 36 AND - CAST( NULL AS SIGNED ) + - - 75
................................................................................
query I rowsort
SELECT ( col2 ) AS col2 FROM tab2 GROUP BY col2
----
58
79
87


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


query II rowsort
SELECT ALL - AVG ( + + col1 ) * col1 col2, col1 AS col2 FROM tab1 GROUP BY col1
----
-1936
44
-3249
57
................................................................................
0
21

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


query III rowsort
SELECT ALL col2 + + col2 col0, col2 * col2 AS col2, 87 FROM tab2 GROUP BY col2
----
9 values hashing to 33cb52a23dd54bb82284e857c641ea18

query I rowsort
SELECT - 32 * - 19 FROM tab2 AS cor0 GROUP BY col1
................................................................................
----

skipif mysql # not compatible
query I rowsort label-2116
SELECT + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col0 HAVING + CAST ( - col0 AS INTEGER ) IS NULL
----


query I rowsort
SELECT ALL + 39 * - 65 / + col1 + col1 * col1 AS col0 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col0 <= NULL
----

query II rowsort
SELECT DISTINCT col0, - col1 AS col1 FROM tab2 GROUP BY col0, col1
----
................................................................................
query I rowsort
SELECT ALL - col2 + - 41 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-112
-49
-86


query II rowsort
SELECT col1 col0, col1 FROM tab0 GROUP BY col1
----
0
0
81
81
................................................................................
-5278
0
-5336
2
-870

skipif mysql # not compatible

query II rowsort label-2221
SELECT DISTINCT 43 / - - ( - CAST ( - col0 AS INTEGER ) ) col2, - 59 * + col0 - - col0 FROM tab2 AS cor0 GROUP BY col0
----
0
-5278
0
-5336
................................................................................
SELECT - col1 * - + col1 FROM tab0 GROUP BY col1 HAVING NOT + - 36 * col1 IS NOT NULL
----

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


query II rowsort
SELECT ALL + 65 AS col0, col2 AS col2 FROM tab2 AS cor0 WHERE NOT NULL NOT IN ( col2, col2 * + + 24 + - ( col2 ), + 11 * + + col1 ) GROUP BY col1, col2 HAVING NULL NOT BETWEEN ( - col0 + 81 ) AND col0
----

query II rowsort
SELECT col2 AS col2, + 62 AS col0 FROM tab1 GROUP BY col2
----
................................................................................
----

skipif mysql # not compatible
query II rowsort label-2266
SELECT - - col2 AS col1, - col2 * + + 59 + - - CAST ( NULL AS INTEGER ) FROM tab0 WHERE + 29 + + col0 = - + ( - col0 ) GROUP BY col1, col2
----


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

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2268
SELECT DISTINCT - CAST( + + 34 AS SIGNED ) col2 FROM tab1 AS cor0 GROUP BY col2
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2274
SELECT DISTINCT + col2 * 32 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL >= CAST( NULL AS SIGNED ) / col1 - 6
----

skipif mysql # not compatible

query I rowsort label-2274
SELECT DISTINCT + col2 * 32 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL >= CAST ( NULL AS INTEGER ) / col1 - 6
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT ( + 49 ) IS NULL
----
................................................................................
query I rowsort label-2459
SELECT ALL - col0 + - + col2 / + 29 FROM tab2 GROUP BY col2, col0, col0
----
-18
-93
-94


query II rowsort
SELECT col2 col2, col2 * - + ( - 8 ) FROM tab2 GROUP BY col1, col2
----
58
464
79
632
................................................................................
SELECT DISTINCT - col0 + - COALESCE ( + 92, - + 56 * + ( + col1 DIV 9 ) + 78 * - col2, - 67, - col0 + + 40 ) + + 32 DIV + col0 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-105
-183
-184

skipif mysql # not compatible

query I rowsort label-2532
SELECT DISTINCT - col0 + - COALESCE ( + 92, - + 56 * + ( + col1 / 9 ) + 78 * - col2, - 67, - col0 + + 40 ) + + 32 / + col0 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-105
-183
-184

................................................................................

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


query II rowsort
SELECT DISTINCT ( 24 ) col1, - col2 * - col2 AS col0 FROM tab0 cor0 GROUP BY col2 HAVING NULL IS NOT NULL
----

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


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

query II rowsort
SELECT - 8 AS col1, + col0 FROM tab1 GROUP BY col1, col0, col0
----
................................................................................
query I rowsort label-2575
SELECT - AVG ( ALL + CAST ( NULL AS INTEGER ) ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL


query II rowsort
SELECT 22 col1, + 2 * ( col1 ) FROM tab0 AS cor0 WHERE 89 IS NULL GROUP BY col1
----

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

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-2602
SELECT DISTINCT 34 * + + col2 * + AVG ( ALL - 64 ) + + col2 col1, CAST( NULL AS DECIMAL ) / - col0 / col0 FROM tab1 GROUP BY col0, col2 HAVING NOT ( - col2 >= NULL )
----

skipif mysql # not compatible

query II rowsort label-2602
SELECT DISTINCT 34 * + + col2 * + AVG ( ALL - 64 ) + + col2 col1, CAST ( NULL AS REAL ) / - col0 / col0 FROM tab1 GROUP BY col0, col2 HAVING NOT ( - col2 >= NULL )
----

query I rowsort
SELECT ALL col1 + + col0 FROM tab2 GROUP BY col0, col1 HAVING - 6 IS NOT NULL
----
................................................................................
-8

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


query II rowsort
SELECT - + 20 - + col2 col0, col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-107
87
-78
58
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2716
SELECT + col1 AS col0 FROM tab0 GROUP BY col1 HAVING + + 48 BETWEEN + + 73 AND col0 * + CAST( + 28 AS SIGNED )
----

skipif mysql # not compatible

query I rowsort label-2716
SELECT + col1 AS col0 FROM tab0 GROUP BY col1 HAVING + + 48 BETWEEN + + 73 AND col0 * + CAST ( + 28 AS INTEGER )
----

query I rowsort
SELECT 90 FROM tab0 GROUP BY col0
----
................................................................................
28
82

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) IN ( - 60 )
----


query I rowsort
SELECT + 89 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NOT NULL >= col2 / col2
----

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0, col1 HAVING ( NULL ) IN ( - col0 )
----
................................................................................
query I rowsort
SELECT + ( - col0 ) AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92


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

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

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


query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) >= + col2 + + col1 * + 71
----

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

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


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

query II rowsort
SELECT - + 24, + col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
................................................................................
-8281
-8464

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


query I rowsort
SELECT ALL + ( col0 ) AS col1 FROM tab1 GROUP BY col0 HAVING ( NULL ) NOT BETWEEN 67 + col0 * + col1 AND + col0
----

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


query II rowsort
SELECT col1, - COALESCE ( 52, - col0 * - + col0 + - + col2 ) FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - 91 / + 60 IS NULL
----
41
-52
59
-52
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3051
SELECT ALL + CAST( NULL AS SIGNED ) - 37, - 43 / - COALESCE ( - 92, - col0 * 85 + + col0 ) + - 19 - 10 * 97 FROM tab0 GROUP BY col1, col2, col1 HAVING NOT 21 = NULL
----

skipif mysql # not compatible

query II rowsort label-3051
SELECT ALL + CAST ( NULL AS INTEGER ) - 37, - 43 / - COALESCE ( - 92, - col0 * 85 + + col0 ) + - 19 - 10 * 97 FROM tab0 GROUP BY col1, col2, col1 HAVING NOT 21 = NULL
----

query I rowsort
SELECT DISTINCT ( + col0 ) * + + 19 AS col2 FROM tab1 GROUP BY col0
----
................................................................................
58
58
79
79
87
87


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

query II rowsort
SELECT DISTINCT - 12 AS col1, 4 / col0 AS col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----
................................................................................
1166
22
1484
28
4346
82


query II rowsort
SELECT ALL - 74 - - 47 + + - 82 col2, col0 FROM tab0 AS cor0 WHERE NOT - col1 IS NULL GROUP BY col1, col0 HAVING col1 IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 34 + + 62 * - + col1 col0 FROM tab2 GROUP BY col1
................................................................................
query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING - col0 IS NOT NULL
----
-15
-91
-92


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

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

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3242
SELECT DISTINCT - - col1 / + col1 - COALESCE ( 56, col0 * + 88 + CAST( NULL AS SIGNED ) * + - col0 + + col1 * - col2 ) * col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col0 <= ( NULL )
----

skipif mysql # not compatible

query I rowsort label-3242
SELECT DISTINCT - - col1 / + col1 - COALESCE ( 56, col0 * + 88 + CAST ( NULL AS INTEGER ) * + - col0 + + col1 * - col2 ) * col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col0 <= ( NULL )
----

query I rowsort
SELECT 72 FROM tab2 GROUP BY col2, col1 HAVING col1 IN ( + - col2 + - + col2 )
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3251
SELECT CAST( NULL AS SIGNED ) + 73 * col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible

query I rowsort label-3251
SELECT CAST ( NULL AS INTEGER ) + 73 * col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT 42 + + col0 AS col0 FROM tab2 GROUP BY col0
----
................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3355
SELECT DISTINCT - + CASE col2 WHEN - CAST( NULL AS SIGNED ) THEN + - col1 END * - ( - col1 ) - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + - col1 IS NULL
----
NULL

skipif mysql # not compatible

query I rowsort label-3355
SELECT DISTINCT - + CASE col2 WHEN - CAST ( NULL AS INTEGER ) THEN + - col1 END * - ( - col1 ) - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + - col1 IS NULL
----
NULL

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

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3375
SELECT ALL + COALESCE ( + + 36, - 17 * - - col1 + + col2, col0 ) AS col1 FROM tab2 GROUP BY col2, col0 HAVING NULL NOT BETWEEN - CAST( 60 AS SIGNED ) / - CAST( - col1 AS SIGNED ) AND + 12
----

skipif mysql # not compatible

query I rowsort label-3375
SELECT ALL + COALESCE ( + + 36, - 17 * - - col1 + + col2, col0 ) AS col1 FROM tab2 GROUP BY col2, col0 HAVING NULL NOT BETWEEN - CAST ( 60 AS INTEGER ) / - CAST ( - col1 AS INTEGER ) AND + 12
----

onlyif mysql # CAST syntax: SIGNED type: 
query III rowsort label-3376
SELECT ALL + col2 + + 38, - col2, + 67 col2 FROM tab0 WHERE NOT ( - + 61 ) <> - CAST( + CAST( NULL AS SIGNED ) AS SIGNED ) GROUP BY col2 HAVING ( + col2 ) = - 86
................................................................................
-79
-79

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 WHERE - col0 BETWEEN NULL AND col1 GROUP BY col1, col0
----


query I rowsort
SELECT + + CASE - 56 WHEN + 63 THEN col2 * + 96 * col1 / + - 84 / + - col2 + + col1 ELSE NULL END AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
NULL
NULL
NULL

................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3523
SELECT - col2 col1, - col0 FROM tab1 WHERE + CAST( + col0 AS SIGNED ) + - NULLIF ( 91, + - 5 + 87 ) IS NOT NULL GROUP BY col0, col2, col1 HAVING NOT col2 / + 87 + + col1 IS NOT NULL
----

skipif mysql # not compatible

query II rowsort label-3523
SELECT - col2 col1, - col0 FROM tab1 WHERE + CAST ( + col0 AS INTEGER ) + - NULLIF ( 91, + - 5 + 87 ) IS NOT NULL GROUP BY col0, col2, col1 HAVING NOT col2 / + 87 + + col1 IS NOT NULL
----

query II rowsort
SELECT + col2 AS col2, - col2 AS col0 FROM tab0 GROUP BY col2, col2
----
................................................................................
query I rowsort
SELECT ALL + 64 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
64
64
64


query I rowsort
SELECT col2 * - + COALESCE ( + 81, + col2, - + col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL NOT IN ( + + ( - 67 ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3568
SELECT DISTINCT col2, + col2 AS col1 FROM tab1 AS cor0 WHERE + col2 * - - col2 <= - CAST( col1 AS SIGNED ) GROUP BY col2, col1 HAVING NOT + col1 IS NULL
................................................................................
query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col0, col2, col1
----
26
43
83


query II rowsort
SELECT DISTINCT + - col1 col1, + col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) = - col0 GROUP BY col1
----

query I rowsort
SELECT col1 - - 79 + col1 FROM tab1 AS cor0 GROUP BY col1
----
................................................................................
query I rowsort label-3747
SELECT - col1 * + COALESCE ( + - 80, + + col0, col2 + col0 DIV col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6480

skipif mysql # not compatible

query I rowsort label-3747
SELECT - col1 * + COALESCE ( + - 80, + + col0, col2 + col0 / col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6480

query I rowsort
................................................................................
----

skipif mysql # not compatible
query I rowsort label-3778
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING - col1 / - 94 * + CAST ( NULL AS INTEGER ) IS NOT NULL
----


query II rowsort
SELECT DISTINCT col2 - + col2 AS col1, ( + col2 ) * - col2 * + + 40 * + 9 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL BETWEEN ( col2 * + col0 ) AND NULL
----

query I rowsort
SELECT - col2 + - - ( + col2 ) + + + col2 FROM tab0 GROUP BY col2
----
................................................................................
onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3949
SELECT DISTINCT - NULLIF ( + ( CAST( NULL AS DECIMAL ) ), - col1 ) * + col0 AS col2 FROM tab1 WHERE NOT - 41 + 34 * col0 = + - col0 GROUP BY col0
----
NULL

skipif mysql # not compatible

query I rowsort label-3949
SELECT DISTINCT - NULLIF ( + ( CAST ( NULL AS REAL ) ), - col1 ) * + col0 AS col2 FROM tab1 WHERE NOT - 41 + 34 * col0 = + - col0 GROUP BY col0
----
NULL

query I rowsort
SELECT - col2 * + col2 FROM tab1 WHERE - ( - ( - col0 ) ) NOT IN ( - col0 ) GROUP BY col2, col2
................................................................................
SELECT - + col1 DIV + col1 + col1 + - 98 + + - col1 DIV + COALESCE ( 39, - 78 * + col0 * ( + col2 ) - + 27, + 50 ) AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-39
-41
-59

skipif mysql # not compatible

query I rowsort label-4012
SELECT - + col1 / + col1 + col1 + - 98 + + - col1 / + COALESCE ( 39, - 78 * + col0 * ( + col2 ) - + 27, + 50 ) AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-39
-41
-59

................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4036
SELECT col0 + 74 AS col1, col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL <> CAST( + + col2 AS SIGNED ) + - NULLIF ( - + col2, - - col1 + - col2 )
----

skipif mysql # not compatible

query II rowsort label-4036
SELECT col0 + 74 AS col1, col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL <> CAST ( + + col2 AS INTEGER ) + - NULLIF ( - + col2, - - col1 + - col2 )
----

query I rowsort
SELECT ALL + col1 + - - col1 + + + col2 - + 23 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
................................................................................
SELECT + col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL > - ( 44 ) * - ( + CAST ( + 38 AS REAL ) ) * + + 40
----

query I rowsort
SELECT DISTINCT 62 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NOT ( - COALESCE ( + - 19, ( - 66 ) + + 13 ) ) <= ( NULL )
----


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

query I rowsort
SELECT DISTINCT - 65 AS col0 FROM tab2 AS cor0 WHERE NOT - col1 IS NOT NULL GROUP BY col0, col1 HAVING NULL IS NULL
----
................................................................................
query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING + 87 IS NOT NULL
----
45
71
8


query I rowsort
SELECT DISTINCT + COALESCE ( 65, col2 * - col2 / - col2 + + col2 + - 26 + col0, + - col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL <= + - col0
----

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

query I rowsort
SELECT ALL col1 * ( + - col0 ) FROM tab0 GROUP BY col1, col0 HAVING + 52 + - col0 * + 98 IS NULL
----


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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab2 WHERE ( NULL ) <> ( NULL ) GROUP BY col0, col2, col0 HAVING - col2 >= 17 * - ( AVG ( - ( col1 ) ) )
................................................................................
query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING 75 IS NOT NULL
----
24
38
79


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

query I rowsort
SELECT ALL - 12 * col0 AS col0 FROM tab2 GROUP BY col1, col0
----
................................................................................
query I rowsort
SELECT ALL 96 AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
96
96
96


query II rowsort
SELECT DISTINCT col0 col1, - col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0
----
22
-22
28
-28
................................................................................
query I rowsort label-4485
SELECT DISTINCT col2 + - + 69 / + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
0
44
71


query I rowsort
SELECT ALL col1 + + col1 + - col1 * - col1 + - col2 - - col1 AS col0 FROM tab2 AS cor0 WHERE - col2 + - 42 IS NULL GROUP BY col1, col2, col1 HAVING ( NULL ) NOT BETWEEN col0 AND - col0 / - - col0 * col0 + col2
----

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


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

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4511
SELECT - - col0 / 19 * 7 + - col0 * + CAST ( - col0 AS REAL ) - + + CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) col1 FROM tab0 cor0 GROUP BY col0 HAVING NULL NOT BETWEEN ( - ( - col1 ) ) AND NULL
----


query II rowsort
SELECT + col1 col0, - col1 * col1 AS col0 FROM tab1 GROUP BY col1
----
44
-1936
57
-3249
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4530
SELECT - ( - + CAST( + 34 AS SIGNED ) ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL NOT BETWEEN + col1 AND NULL
----

skipif mysql # not compatible

query I rowsort label-4530
SELECT - ( - + CAST ( + 34 AS INTEGER ) ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL NOT BETWEEN + col1 AND NULL
----

query I rowsort
SELECT - col1 * + - col1 * + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
................................................................................
-58
58
-79
79
-87
87


query I rowsort
SELECT ALL col1 * col0 AS col2 FROM tab0 cor0 GROUP BY col0, col1 HAVING NOT NULL NOT IN ( + - NULLIF ( + - NULLIF ( col2, 11 - - ( - 78 ) + + col2 * col1 * + col0 ), - NULLIF ( + col0, - col0 ) + + col0 * - - col1 + col1 ) )
----

query I rowsort
SELECT + col2 AS col1 FROM tab2 WHERE + col0 IS NOT NULL GROUP BY col2
----
................................................................................
query I rowsort
SELECT 10 * col2 + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
216
342
711


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

onlyif mysql # aggregate syntax: 
query II rowsort label-4682
SELECT - ( + - 6 ) + - col2 * + SUM( ALL - 46 ) / - - ( 48 ), CASE WHEN NOT col2 IS NULL THEN NULL WHEN 71 IS NULL THEN - ( col1 ) * - col0 * + - 64 / - AVG ( 57 ) END FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( + COUNT( * ) > NULL )
----

skipif mysql # not compatible

query II rowsort label-4682
SELECT - ( + - 6 ) + - col2 * + SUM ( ALL - 46 ) / - - ( 48 ), CASE WHEN NOT col2 IS NULL THEN NULL WHEN 71 IS NULL THEN - ( col1 ) * - col0 * + - 64 / - AVG ( 57 ) END FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( + COUNT ( * ) > NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4683
SELECT ALL CAST( NULL AS SIGNED ) + + 63 FROM tab1 AS cor0 GROUP BY col0
................................................................................
query I rowsort
SELECT - col2 * + 52 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-2340
-3692
-416


query I rowsort
SELECT COALESCE ( + - 30, - col0 - + 41, 26 * - col0 - - 14 * - 43 ) + + col1 AS col0 FROM tab2 GROUP BY col1
----
11
29
31

................................................................................
SELECT ALL - CASE - CAST( NULL AS SIGNED ) WHEN + + 47 THEN + col0 + col1 END * COALESCE ( - 7, 76 * 59, + 47 ) FROM tab1 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible

query I rowsort label-4811
SELECT ALL - CASE - CAST ( NULL AS INTEGER ) WHEN + + 47 THEN + col0 + col1 END * COALESCE ( - 7, 76 * 59, + 47 ) FROM tab1 GROUP BY col2, col0
----
NULL
NULL
NULL

................................................................................
-1
12
-1
2
-1

skipif mysql # not compatible

query II rowsort label-4826
SELECT + - 99 / - col2 col0, - ( - col2 ) / - col2 + col2 - + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
1
-1
12
-1
................................................................................
query I rowsort
SELECT + ( + 55 ) + col0 * - - col0 + 0 FROM tab0 AS cor0 GROUP BY col0
----
1904
6944
731


query II rowsort
SELECT DISTINCT col1 * col1 * + 1 + col1 col1, 72 + - col1 FROM tab1 GROUP BY col1
----
1980
28
3306
15
................................................................................

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


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

query I rowsort
SELECT ( + 21 ) AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL >= NULL
----
................................................................................
SELECT ALL - - COALESCE ( - 85, col2 * - + CAST( + 49 AS SIGNED ), + col1 ) FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-85
-85
-85

skipif mysql # not compatible

query I rowsort label-4923
SELECT ALL - - COALESCE ( - 85, col2 * - + CAST ( + 49 AS INTEGER ), + col1 ) FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-85
-85
-85

................................................................................
----

skipif mysql # not compatible
query I rowsort label-4972
SELECT MIN ( - col2 ) + 20 * + 10 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT + COUNT ( * ) / + 88 - col0 * 11 NOT BETWEEN NULL AND col0
----


query I rowsort
SELECT - col0 * 1 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NULL NOT BETWEEN col1 * 72 + ( 33 ) AND 17 * col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4974
SELECT + ( + COUNT( * ) ) FROM tab0 GROUP BY col2, col2
................................................................................
SELECT - CASE + - CAST( NULL AS SIGNED ) WHEN - col0 * - + 67 + + 17 THEN NULL WHEN CAST( NULL AS SIGNED ) THEN - CAST( 37 AS SIGNED ) * - - col1 - + COUNT( * ) + + + COUNT( * ) END + - + ( CAST( + 88 AS DECIMAL ) ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible

query I rowsort label-5014
SELECT - CASE + - CAST ( NULL AS INTEGER ) WHEN - col0 * - + 67 + + 17 THEN NULL WHEN CAST ( NULL AS INTEGER ) THEN - CAST ( 37 AS INTEGER ) * - - col1 - + COUNT ( * ) + + + COUNT ( * ) END + - + ( CAST ( + 88 AS REAL ) ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

................................................................................
query II rowsort label-5017
SELECT DISTINCT + COUNT( * ) col0, + COALESCE ( - 50, - col1, + COUNT( ALL 34 ) * - col0 ) FROM tab2 GROUP BY col1, col1, col1
----
1
-50

skipif mysql # not compatible

query II rowsort label-5017
SELECT DISTINCT + COUNT ( * ) col0, + COALESCE ( - 50, - col1, + COUNT ( ALL 34 ) * - col0 ) FROM tab2 GROUP BY col1, col1, col1
----
1
-50

query I rowsort
................................................................................
query I rowsort
SELECT DISTINCT + col1 * ( col2 ) FROM tab1 GROUP BY col2, col1
----
2565
3124
48


query I rowsort
SELECT COALESCE ( + col0, 19, - col2 - col2, + col1 ) * col0 FROM tab0 GROUP BY col0
----
1849
676
6889

................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5046
SELECT DISTINCT CASE - 75 WHEN CAST( NULL AS SIGNED ) THEN col1 END * - col0 FROM tab0 GROUP BY col0, col2 HAVING NOT + AVG ( 29 ) IN ( - col2 )
----
NULL

skipif mysql # not compatible

query I rowsort label-5046
SELECT DISTINCT CASE - 75 WHEN CAST ( NULL AS INTEGER ) THEN col1 END * - col0 FROM tab0 GROUP BY col0, col2 HAVING NOT + AVG ( 29 ) IN ( - col2 )
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-5047
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-5120
SELECT DISTINCT + col2 * + MIN( 66 ) * + 40 AS col0 FROM tab1 GROUP BY col2, col1, col2 HAVING ( NULL ) BETWEEN + 67 * col0 AND NULL
----

skipif mysql # not compatible

query I rowsort label-5120
SELECT DISTINCT + col2 * + MIN ( 66 ) * + 40 AS col0 FROM tab1 GROUP BY col2, col1, col2 HAVING ( NULL ) BETWEEN + 67 * col0 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5121
SELECT DISTINCT + col0 FROM tab2 cor0 GROUP BY col0, col2 HAVING NOT ( - CAST( NULL AS SIGNED ) ) <= ( CAST( NULL AS SIGNED ) )
................................................................................
----

skipif mysql # not compatible
query I rowsort label-5138
SELECT DISTINCT CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 WHERE NOT NULL IN ( col1 ) GROUP BY col1
----


query I rowsort
SELECT ALL 40 - - col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT ( - + col1 * + col0 ) <= ( NULL )
----

query I rowsort
SELECT DISTINCT col0 * + + col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT - + 26 IS NOT NULL
----
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-5151
SELECT 37 * + COUNT( * ) AS col0 FROM tab0 GROUP BY col1, col2 HAVING NULL BETWEEN ( NULLIF ( col1, col1 / col0 + col1 + - col1 ) * + COUNT( * ) ) AND ( NULL )
----

skipif mysql # not compatible

query I rowsort label-5151
SELECT 37 * + COUNT ( * ) AS col0 FROM tab0 GROUP BY col1, col2 HAVING NULL BETWEEN ( NULLIF ( col1, col1 / col0 + col1 + - col1 ) * + COUNT ( * ) ) AND ( NULL )
----

query I rowsort
SELECT ALL + + col0 + + + 86 * + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IN ( 73 )
----
................................................................................
0
2
0
3
81

skipif mysql # not compatible

query II rowsort label-5241
SELECT DISTINCT - - 81 / - - col2 col1, col1 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING ( + col2 / + 58 ) <> 48
----
1
0
2
0
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5300
SELECT ALL col1 * - col1 + col1 + col1 + - 7 * - CASE + 93 WHEN 33 THEN - col0 / COUNT( * ) * - col1 + + 1 WHEN - CAST( NULL AS SIGNED ) + + 86 THEN + AVG ( - - col0 ) END * 47 FROM tab2 AS cor0 WHERE NOT NULL > - 75 GROUP BY col1, col1
----

skipif mysql # not compatible

query I rowsort label-5300
SELECT ALL col1 * - col1 + col1 + col1 + - 7 * - CASE + 93 WHEN 33 THEN - col0 / COUNT ( * ) * - col1 + + 1 WHEN - CAST ( NULL AS INTEGER ) + + 86 THEN + AVG ( - - col0 ) END * 47 FROM tab2 AS cor0 WHERE NOT NULL > - 75 GROUP BY col1, col1
----

query II rowsort
SELECT ALL + col1, - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
................................................................................

onlyif mysql # aggregate syntax: 
query II rowsort label-5327
SELECT ALL - 89 AS col0, MAX( ALL - col0 ) AS col2 FROM tab2 GROUP BY col0 HAVING NULL = col2
----

skipif mysql # not compatible

query II rowsort label-5327
SELECT ALL - 89 AS col0, MAX ( ALL - col0 ) AS col2 FROM tab2 GROUP BY col0 HAVING NULL = col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5328
SELECT DISTINCT - 48 + - col1 * + 71 + + - 11 * - 27 FROM tab0 GROUP BY col1 HAVING NOT NULL BETWEEN - col1 AND + col1 * CAST( 13 AS SIGNED ) + + 72 + 65 * - 24
................................................................................

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5330
SELECT + CAST( NULL AS DECIMAL ) + - 66 / + col2 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL >= col0
----

skipif mysql # not compatible

query I rowsort label-5330
SELECT + CAST ( NULL AS REAL ) + - 66 / + col2 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL >= col0
----

query I rowsort
SELECT DISTINCT - 11 FROM tab1 GROUP BY col2, col1
----
................................................................................
NULL
29
NULL
29
NULL

skipif mysql # not compatible

query II rowsort label-5392
SELECT ALL + 29 col0, 33 * - MIN ( CAST ( + CASE col1 WHEN + 26 THEN + col1 END AS INTEGER ) ) - col2 * - NULLIF ( 6, col0 ) FROM tab2 GROUP BY col2, col0, col2
----
29
NULL
29
NULL
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5394
SELECT col1 AS col2 FROM tab2 WHERE - - 60 - + col1 BETWEEN + col2 / col1 AND + col0 * + ( CAST( NULL AS SIGNED ) ) GROUP BY col1 HAVING NOT NULL < + col2
----

skipif mysql # not compatible

query I rowsort label-5394
SELECT col1 AS col2 FROM tab2 WHERE - - 60 - + col1 BETWEEN + col2 / col1 AND + col0 * + ( CAST ( NULL AS INTEGER ) ) GROUP BY col1 HAVING NOT NULL < + col2
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5395
SELECT ALL + - COALESCE ( + col1, + - col0 DIV COUNT( * ) * - + col1 * 21 + MIN( + 23 ), - col0 * 53 + - ( col1 ) * - col0 ) FROM tab0 AS cor0 GROUP BY col0, col1
................................................................................
skipif mysql # not compatible
query I rowsort label-5463
SELECT ALL + + COUNT ( * ) * 8 FROM tab0 AS cor0 GROUP BY col1
----
16
8


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

onlyif mysql # aggregate syntax: 
query I rowsort label-5465
SELECT DISTINCT + COUNT( * ) AS col0 FROM tab0 GROUP BY col2 HAVING NOT - - ( 69 ) < col2
................................................................................
-58
-1851360
-58
-5421840
-58

skipif mysql # not compatible

query II rowsort label-5557
SELECT MIN ( DISTINCT + 29 ) * + COUNT ( * ) * - - 95 * - ( - col0 ) * + ( - 24 ), - COALESCE ( ( + + 58 ), + - col0 + col2 * + 40 + - 27, + 25 ) AS col1 FROM tab1 GROUP BY col0
----
-1454640
-58
-1851360
-58
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-5581
SELECT ALL + COALESCE ( + + MIN( DISTINCT 49 ), + - COUNT( * ), + COUNT( * ) * + 97 ) * 8 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL >= + col2 / + - 43 * - ( - col2 )
----

skipif mysql # not compatible

query I rowsort label-5581
SELECT ALL + COALESCE ( + + MIN ( DISTINCT 49 ), + - COUNT ( * ), + COUNT ( * ) * + 97 ) * 8 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL >= + col2 / + - 43 * - ( - col2 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5582
SELECT - SUM( + col2 ) * COUNT( * ) - + - 56 + - col2 FROM tab0 WHERE NOT + col2 <> ( - col2 ) GROUP BY col2, col0
................................................................................

onlyif mysql # aggregate syntax: 
query III rowsort label-5677
SELECT 65 - 20 * + MAX( ALL - col0 ) - + - col0 * + col0, + col0 col0, - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL < - 6 / + + COUNT( col0 )
----

skipif mysql # not compatible

query III rowsort label-5677
SELECT 65 - 20 * + MAX ( ALL - col0 ) - + - col0 * + col0, + col0 col0, - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL < - 6 / + + COUNT ( col0 )
----

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

onlyif mysql # aggregate syntax: 
query II rowsort label-5679
SELECT DISTINCT - col2, + COUNT( * ) + + + col2 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT - col0 <> NULL
----

skipif mysql # not compatible

query II rowsort label-5679
SELECT DISTINCT - col2, + COUNT ( * ) + + + col2 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT - col0 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col2, col2 + + col2 col2 FROM tab0 AS cor0 GROUP BY col2
................................................................................
-15
-65
-91
-65
-92

skipif mysql # not compatible

query II rowsort label-5720
SELECT - 65 col2, COUNT ( * ) * - ( + col0 ) FROM tab2 GROUP BY col0, col0 HAVING NOT ( NOT ( MIN ( - + col2 ) IS NOT NULL ) )
----
-65
-15
-65
-91
................................................................................
query I rowsort label-5752
SELECT ALL - MIN ( ALL + - col0 ) / col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + col0 IS NULL
----
1
1
1


query I rowsort
SELECT ALL + COALESCE ( col0, - 17 + 18, - ( + - 1 ) + ( + + col1 ) - - + 65 ) FROM tab1 cor0 GROUP BY col0
----
22
28
82

................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5757
SELECT col2 * - + CAST( NULL AS SIGNED ) + + col2 AS col1 FROM tab1 WHERE NOT ( NOT NULL < + col0 + + col0 ) GROUP BY col2 HAVING NOT NULL = + 70 + - + col1 AND 60 - + COUNT( * ) + col2 + - col1 <> NULL
----

skipif mysql # not compatible

query I rowsort label-5757
SELECT col2 * - + CAST ( NULL AS INTEGER ) + + col2 AS col1 FROM tab1 WHERE NOT ( NOT NULL < + col0 + + col0 ) GROUP BY col2 HAVING NOT NULL = + 70 + - + col1 AND 60 - + COUNT ( * ) + col2 + - col1 <> NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 GROUP BY col0 HAVING NULL = NULL
----
................................................................................
----

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


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


query II rowsort
SELECT ALL + col1 col0, col1 FROM tab1 GROUP BY col1 HAVING + 20 < - 77
----

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

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


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

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

skipif mysql # not compatible
query I rowsort label-5829
SELECT DISTINCT + 13 + - CAST ( - col2 AS INTEGER ) + + col2 * - 21 FROM tab1 AS cor0 WHERE NOT ( NULL ) NOT BETWEEN NULL AND - col2 GROUP BY col2, col1
----


query I rowsort
SELECT ALL - 98 + col2 + + COALESCE ( - - ( - 21 ), + - ( col0 ) ) * ( - col2 ) * + col2 + - col2 FROM tab1 AS cor0 GROUP BY col2
----
105763
1246
42427


query I rowsort
SELECT DISTINCT + 8 + + 52 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL >= col2 + col1
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5832
SELECT + - col0 * - MAX( - col0 ) * + + col0 * + + col0 + - col0 FROM tab1 AS cor0 GROUP BY col0
................................................................................
SELECT CASE + 58 WHEN + 5 THEN col0 END col0 FROM tab0 GROUP BY col0, col0, col2 HAVING ( + 30 ) NOT BETWEEN NULL AND - COUNT( * ) + - col2
----
NULL
NULL
NULL

skipif mysql # not compatible

query I rowsort label-5853
SELECT CASE + 58 WHEN + 5 THEN col0 END col0 FROM tab0 GROUP BY col0, col0, col2 HAVING ( + 30 ) NOT BETWEEN NULL AND - COUNT ( * ) + - col2
----
NULL
NULL
NULL

................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5884
SELECT - - ( + 90 ) AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <= - + 21 * ( + 30 / 82 + MIN( DISTINCT CAST( NULL AS SIGNED ) ) ) + ( col1 - COUNT( * ) / 80 ) * + 28
----

skipif mysql # not compatible

query I rowsort label-5884
SELECT - - ( + 90 ) AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <= - + 21 * ( + 30 / 82 + MIN ( DISTINCT CAST ( NULL AS INTEGER ) ) ) + ( col1 - COUNT ( * ) / 80 ) * + 28
----

query I rowsort
SELECT ALL + col1 + + col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
................................................................................
query I rowsort label-5924
SELECT DISTINCT col1 * - CASE WHEN NULL NOT IN ( 52, - col0, + col0 + ( + + COUNT( * ) ), - CAST( NULL AS SIGNED ) ) THEN + - NULLIF ( - 84, + - SUM( + col2 ) - 35 ) ELSE COUNT( * ) END FROM tab0 GROUP BY col1
----
-81
0

skipif mysql # not compatible

query I rowsort label-5924
SELECT DISTINCT col1 * - CASE WHEN NULL NOT IN ( 52, - col0, + col0 + ( + + COUNT ( * ) ), - CAST ( NULL AS INTEGER ) ) THEN + - NULLIF ( - 84, + - SUM ( + col2 ) - 35 ) ELSE COUNT ( * ) END FROM tab0 GROUP BY col1
----
-81
0

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5932
SELECT ALL col2 + col2 - - 43 * + - COUNT( * ) / CASE + CAST( NULL AS SIGNED ) WHEN - - COALESCE ( - + 59, col1 / col1 * + COUNT( ALL + - 40 ) * - 52, - - CASE WHEN col1 NOT BETWEEN NULL AND NULL THEN NULL ELSE 33 + + col0 / 65 END * col2 ) * - col2 + col0 THEN - COUNT( * ) WHEN col0 THEN NULL END FROM tab2 GROUP BY col0, col2 HAVING ( col0 ) BETWEEN ( CAST( NULL AS SIGNED ) ) AND NULLIF ( - CAST( NULL AS SIGNED ), 92 + + ( - AVG ( DISTINCT col2 ) ) / 76 )
----

skipif mysql # not compatible

query I rowsort label-5932
SELECT ALL col2 + col2 - - 43 * + - COUNT ( * ) / CASE + CAST ( NULL AS INTEGER ) WHEN - - COALESCE ( - + 59, col1 / col1 * + COUNT ( ALL + - 40 ) * - 52, - - CASE WHEN col1 NOT BETWEEN NULL AND NULL THEN NULL ELSE 33 + + col0 / 65 END * col2 ) * - col2 + col0 THEN - COUNT ( * ) WHEN col0 THEN NULL END FROM tab2 GROUP BY col0, col2 HAVING ( col0 ) BETWEEN ( CAST ( NULL AS INTEGER ) ) AND NULLIF ( - CAST ( NULL AS INTEGER ), 92 + + ( - AVG ( DISTINCT col2 ) ) / 76 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5933
SELECT MAX( - ( - col1 ) ) FROM tab2 cor0 GROUP BY col1, col1
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5990
SELECT DISTINCT - ( - COALESCE ( 45, + col2, + col1, CAST( + COUNT( * ) AS SIGNED ) ) ) FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

skipif mysql # not compatible

query I rowsort label-5990
SELECT DISTINCT - ( - COALESCE ( 45, + col2, + col1, CAST ( + COUNT ( * ) AS INTEGER ) ) ) FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT 40 FROM tab0 GROUP BY col2, col1
----
................................................................................
query I rowsort label-6112
SELECT + ( + 59 ) + ( + NULLIF ( 79, + ( + COUNT ( * ) ) ) ) FROM tab2 GROUP BY col0, col1, col1
----
138
138
138


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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + 74 col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT ( + col1 ) < ( NULL )
................................................................................
query I rowsort
SELECT + ( - col2 ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IS NULL
----
-24
-38
-79


query II rowsort
SELECT + + col2 col2, 27 FROM tab0 cor0 GROUP BY col2
----
24
27
38
27
................................................................................
SELECT + - NULLIF ( - CAST( NULL AS SIGNED ), + CAST( 46 AS SIGNED ) + - CAST( + col0 AS DECIMAL ) ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible

query I rowsort label-6154
SELECT + - NULLIF ( - CAST ( NULL AS INTEGER ), + CAST ( 46 AS INTEGER ) + - CAST ( + col0 AS REAL ) ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

................................................................................
-24
144
-38
228
-79
474


query I rowsort
SELECT - 0 AS col2 FROM tab2 GROUP BY col0 HAVING - col2 - col0 < NULL
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6161
SELECT ALL 92, COUNT( * ) FROM tab0 GROUP BY col0 HAVING + 14 IS NULL
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-6165
SELECT DISTINCT + col0 * - col0 + MIN( + 27 ) AS col2 FROM tab0 AS cor0 WHERE - col0 IS NULL GROUP BY col0 HAVING NOT - col2 <= NULL
----

skipif mysql # not compatible

query I rowsort label-6165
SELECT DISTINCT + col0 * - col0 + MIN ( + 27 ) AS col2 FROM tab0 AS cor0 WHERE - col0 IS NULL GROUP BY col0 HAVING NOT - col2 <= NULL
----

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

onlyif mysql # aggregate syntax: 
query I rowsort label-6176
SELECT ALL + - COUNT( * ) * + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING - 19 + col2 > NULL
----

skipif mysql # not compatible

query I rowsort label-6176
SELECT ALL + - COUNT ( * ) * + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING - 19 + col2 > NULL
----

query I rowsort
SELECT 40 AS col1 FROM tab0 AS cor0 WHERE NOT + 91 + - 78 - + col1 IS NULL GROUP BY col2
----
................................................................................
49

query I rowsort
SELECT ALL + col0 * 4 FROM tab1 WHERE NOT col0 BETWEEN + 24 AND + + col0 GROUP BY col0, col2
----
88


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

query I rowsort
SELECT col0 AS col2 FROM tab2 WHERE NULL > - + col0 - 41 + + 14 GROUP BY col1, col0 HAVING NOT + + col0 IS NOT NULL
----
................................................................................

onlyif mysql # aggregate syntax: 
query II rowsort label-6199
SELECT ALL + + col2 * col0 - - 89 col1, - 93 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING col0 + - + 4 BETWEEN COUNT( * ) * - + 88 * + + ( col0 ) AND ( NULL )
----

skipif mysql # not compatible

query II rowsort label-6199
SELECT ALL + + col2 * col0 - - 89 col1, - 93 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING col0 + - + 4 BETWEEN COUNT ( * ) * - + 88 * + + ( col0 ) AND ( NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6200
SELECT CAST( NULL AS SIGNED ) AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
................................................................................
query I rowsort label-6231
SELECT col1 - - ( col1 ) / col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
45
58
7


query II rowsort
SELECT + ( 33 ) col0, + col1 FROM tab0 GROUP BY col1 HAVING col1 <> NULL
----

query I rowsort
SELECT ALL + col1 * - - col1 FROM tab0 GROUP BY col1
----
................................................................................
1
-71
1
-8
1

skipif mysql # not compatible

query II rowsort label-6247
SELECT + - MIN ( + col2 ) col0, COUNT ( * ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-45
1
-71
1
................................................................................
query I rowsort
SELECT ( + col2 ) * col2 * 30 - + col2 * - 4 + - col2 FROM tab0 GROUP BY col2
----
17352
187467
43434


query I rowsort
SELECT DISTINCT - COALESCE ( 67, ( + - col0 ) ) FROM tab0 AS cor0 GROUP BY col2
----
-67

query I rowsort
SELECT ALL + col2 * + col2 + + col2 * + 19 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
................................................................................
----
1
50
2
50

skipif mysql # not compatible

query II rowsort label-6325
SELECT COUNT ( * ) col2, + 50 AS col2 FROM tab0 cor0 GROUP BY col1, col1
----
1
50
2
50
................................................................................
query I rowsort label-6327
SELECT + + COUNT ( * ) * + 88 + + + col1 + - COUNT ( * ) * + col1 + + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT 80 * + - col1 IS NULL
----
129
147
149


query III rowsort
SELECT 93 col2, 28 + col1 * - 85 AS col0, col1 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6329
SELECT DISTINCT + COUNT( * ) * - + col0 FROM tab2 GROUP BY col0, col0 HAVING NULL BETWEEN NULL AND COUNT( * ) * - COUNT( * )
................................................................................

onlyif mysql # aggregate syntax: 
query II rowsort label-6341
SELECT - 37 - + col2 * + col2 AS col0, 65 AS col1 FROM tab0 GROUP BY col2 HAVING NULL NOT BETWEEN col1 + + COUNT( * ) AND - 7
----

skipif mysql # not compatible

query II rowsort label-6341
SELECT - 37 - + col2 * + col2 AS col0, 65 AS col1 FROM tab0 GROUP BY col2 HAVING NULL NOT BETWEEN col1 + + COUNT ( * ) AND - 7
----

query II rowsort
SELECT ALL + col2 AS col0, col2 AS col0 FROM tab1 GROUP BY col2
----
................................................................................
query I rowsort label-6353
SELECT COUNT ( + ( - col0 ) ) / 53 col1 FROM tab0 GROUP BY col0
----
0
0
0


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

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DIV for integer division: 
query I rowsort label-6355
SELECT + MAX( ALL + NULLIF ( + COALESCE ( - CAST( col1 AS SIGNED ), 0 ), col2 ) ) DIV 37 FROM tab2 GROUP BY col1
................................................................................
2

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


query I rowsort
SELECT ALL + COALESCE ( ( 36 ), col0 + + col1, - col0 + + col0 ) * col0 AS col0 FROM tab1 GROUP BY col0, col2
----
1008
2952
792

................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-6376
SELECT DISTINCT + ( - col2 ) AS col0 FROM tab2 AS cor0 WHERE NOT ( - 1 * col2 ) <> ( 37 ) GROUP BY col2 HAVING ( col2 ) IN ( COALESCE ( + ( + COALESCE ( - 64, COUNT( * ) + ( col0 ) * 12 ) ), + COUNT( * ), COUNT( * ) / 97 ) )
----

skipif mysql # not compatible

query I rowsort label-6376
SELECT DISTINCT + ( - col2 ) AS col0 FROM tab2 AS cor0 WHERE NOT ( - 1 * col2 ) <> ( 37 ) GROUP BY col2 HAVING ( col2 ) IN ( COALESCE ( + ( + COALESCE ( - 64, COUNT ( * ) + ( col0 ) * 12 ) ), + COUNT ( * ), COUNT ( * ) / 97 ) )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6377
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL ) NOT BETWEEN CAST( NULL AS DECIMAL ) AND ( - col1 )
----

skipif mysql # not compatible

query I rowsort label-6377
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL ) NOT BETWEEN CAST ( NULL AS REAL ) AND ( - col1 )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6378
SELECT + COUNT( * ) FROM tab2 AS cor0 GROUP BY col2 HAVING NOT CAST( NULL AS SIGNED ) NOT IN ( - 58 )
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-6437
SELECT DISTINCT - COUNT( * ) + - col0 + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL NOT BETWEEN + col2 * + NULLIF ( - - COUNT( * ), + col0 ) AND + CASE - col0 WHEN - col2 THEN + MIN( ALL + col2 ) WHEN COUNT( * ) * col0 THEN NULL END
----

skipif mysql # not compatible

query I rowsort label-6437
SELECT DISTINCT - COUNT ( * ) + - col0 + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL NOT BETWEEN + col2 * + NULLIF ( - - COUNT ( * ), + col0 ) AND + CASE - col0 WHEN - col2 THEN + MIN ( ALL + col2 ) WHEN COUNT ( * ) * col0 THEN NULL END
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6438
SELECT 10 AS col2, col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT - 67 * + ( - - COUNT( * ) ) <> + col2 - col0
................................................................................

skipif mysql # not compatible
query I rowsort label-6443
SELECT DISTINCT + SUM ( - + 28 ) FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-28


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

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6445
SELECT - - col0 + + 94 + + col0 * col0 * CAST( + CAST( + 84 AS SIGNED ) AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING ( + COUNT( * ) ) IS NULL
................................................................................

onlyif mysql # aggregate syntax: 
query II rowsort label-6560
SELECT DISTINCT - - col2 * + + col2 - - col2 + col2 col0, + 14 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - 18 NOT IN ( - COUNT( * ) )
----

skipif mysql # not compatible

query II rowsort label-6560
SELECT DISTINCT - - col2 * + + col2 - - col2 + col2 col0, + 14 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - 18 NOT IN ( - COUNT ( * ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6561
SELECT - - SUM( + 56 ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING + 59 IS NOT NULL
................................................................................
SELECT + 23 DIV + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULLIF ( + ( CAST( NULL AS SIGNED ) ), CAST( - COUNT( 12 ) AS DECIMAL ) - col2 ) IS NOT NULL
----
0
0
0

skipif mysql # not compatible

query I rowsort label-6618
SELECT + 23 / + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULLIF ( + ( CAST ( NULL AS INTEGER ) ), CAST ( - COUNT ( 12 ) AS REAL ) - col2 ) IS NOT NULL
----
0
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-6619
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NOT ( NULL ) <> ( - COUNT( * ) + col0 )
----

skipif mysql # not compatible

query I rowsort label-6619
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NOT ( NULL ) <> ( - COUNT ( * ) + col0 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6620
SELECT ALL + COUNT( * ) - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
................................................................................
query I rowsort
SELECT 44 FROM tab2 cor0 GROUP BY col1
----
44
44
44


query I rowsort
SELECT + col2 AS col1 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL <> - NULLIF ( + 3, + col1 )
----

query II rowsort
SELECT + ( - + ( - ( col0 ) ) ) AS col0, + 33 + - col2 FROM tab0 GROUP BY col2, col0
----
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6662
SELECT - 97 + AVG ( ( - + col1 ) ) + 33 + CAST( + 89 AS SIGNED ) / - col1 * - + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT - COUNT( * ) - ( + 5 ) * + col2 = NULL
----

skipif mysql # not compatible

query I rowsort label-6662
SELECT - 97 + AVG ( ( - + col1 ) ) + 33 + CAST ( + 89 AS INTEGER ) / - col1 * - + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT - COUNT ( * ) - ( + 5 ) * + col2 = NULL
----

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 WHERE ( NULL ) = NULL GROUP BY col2
----
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-6668
SELECT DISTINCT MIN( + - col0 ) + + 29 + - + col0 AS col1 FROM tab0 AS cor0 WHERE NOT 57 BETWEEN NULL AND - - col2 GROUP BY col2, col0, col0 HAVING NULL BETWEEN - col1 AND COUNT( * )
----

skipif mysql # not compatible

query I rowsort label-6668
SELECT DISTINCT MIN ( + - col0 ) + + 29 + - + col0 AS col1 FROM tab0 AS cor0 WHERE NOT 57 BETWEEN NULL AND - - col2 GROUP BY col2, col0, col0 HAVING NULL BETWEEN - col1 AND COUNT ( * )
----

query I rowsort
SELECT - col1 + + col1 + - 39 + col1 FROM tab0 GROUP BY col1
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6707
SELECT DISTINCT CAST( NULL AS SIGNED ) col2, - 66 / - col1 * - col1 AS col2 FROM tab0 GROUP BY col0, col1 HAVING col1 + + col2 * - col0 NOT IN ( ( + CAST( NULL AS SIGNED ) ) / 44 + - 73 )
----

skipif mysql # not compatible

query II rowsort label-6707
SELECT DISTINCT CAST ( NULL AS INTEGER ) col2, - 66 / - col1 * - col1 AS col2 FROM tab0 GROUP BY col0, col1 HAVING col1 + + col2 * - col0 NOT IN ( ( + CAST ( NULL AS INTEGER ) ) / 44 + - 73 )
----

onlyif mysql # DIV for integer division: 
query II rowsort label-6708
SELECT + 80 DIV - - 8, + col1 col1 FROM tab2 GROUP BY col1, col2
................................................................................
SELECT ALL ( - - CASE + + 50 WHEN + col2 THEN NULL WHEN ( - 84 ) THEN col2 * + col0 ELSE COUNT( * ) * 39 END ) * + + col2 FROM tab0 GROUP BY col2
----
1482
3081
936

skipif mysql # not compatible

query I rowsort label-6716
SELECT ALL ( - - CASE + + 50 WHEN + col2 THEN NULL WHEN ( - 84 ) THEN col2 * + col0 ELSE COUNT ( * ) * 39 END ) * + + col2 FROM tab0 GROUP BY col2
----
1482
3081
936

................................................................................
skipif mysql # not compatible
query II rowsort label-6789
SELECT DISTINCT - 54 / 27 AS col0, 74 FROM tab0 GROUP BY col0, col0
----
-2
74


query I rowsort
SELECT + NULLIF ( col0, - - 92 ) AS col2 FROM tab1 GROUP BY col0 HAVING NULL < - col2
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL IS NULL )
----
................................................................................
SELECT - COALESCE ( - + 77, + COUNT( + col0 ), + + 2 + - + col1 - col2 + - SUM( DISTINCT - + 97 ) + - - col1 DIV - 77 * - col1 ) FROM tab0 GROUP BY col0, col1
----
77
77
77

skipif mysql # not compatible

query I rowsort label-6808
SELECT - COALESCE ( - + 77, + COUNT ( + col0 ), + + 2 + - + col1 - col2 + - SUM ( DISTINCT - + 97 ) + - - col1 / - 77 * - col1 ) FROM tab0 GROUP BY col0, col1
----
77
77
77

................................................................................
NULL
4
NULL
4
NULL

skipif mysql # not compatible

query II rowsort label-6853
SELECT col0 / - - 20 col1, + COUNT ( * ) + + ( CAST ( NULL AS INTEGER ) ) FROM tab2 AS cor0 GROUP BY col0
----
0
NULL
4
NULL
................................................................................
SELECT - ( - 55 ) * - col2 + COALESCE ( 75, - CASE WHEN NOT + col0 IS NOT NULL THEN NULL WHEN NOT NULL NOT IN ( + 10 + ( + CAST( + 47 AS SIGNED ) ) ) THEN - col1 * + col2 END DIV - 62 ) * - col0 FROM tab2 GROUP BY col2, col0
----
-10090
-11170
-5910

skipif mysql # not compatible

query I rowsort label-6913
SELECT - ( - 55 ) * - col2 + COALESCE ( 75, - CASE WHEN NOT + col0 IS NOT NULL THEN NULL WHEN NOT NULL NOT IN ( + 10 + ( + CAST ( + 47 AS INTEGER ) ) ) THEN - col1 * + col2 END / - 62 ) * - col0 FROM tab2 GROUP BY col2, col0
----
-10090
-11170
-5910

................................................................................
SELECT + COALESCE ( 92, col2 + + 40 * MAX( DISTINCT + 95 ) ) DIV col0 FROM tab1 GROUP BY col0
----
1
3
4

skipif mysql # not compatible

query I rowsort label-6933
SELECT + COALESCE ( 92, col2 + + 40 * MAX ( DISTINCT + 95 ) ) / col0 FROM tab1 GROUP BY col0
----
1
3
4

................................................................................
22
-22
28
-28
82
-82


query II rowsort
SELECT - 20 col1, + 28 * + col0 + + col0 FROM tab2 GROUP BY col0, col0
----
-20
2639
-20
2668
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6967
SELECT - COALESCE ( ( 53 ), COUNT( * ), - NULLIF ( - SUM( DISTINCT - CAST( NULL AS SIGNED ) ), CASE - col0 WHEN COUNT( * ) / - ( - col1 ) THEN - col2 - col0 ELSE - COALESCE ( col0, + 78 + + ( col2 ) * ( col0 ) ) * - col2 END ) ) FROM tab2 AS cor0 WHERE NOT - ( + ( col1 ) ) - + - col2 + col2 + - col2 + + - col2 * 74 + - col0 IS NOT NULL GROUP BY col0, col1
----

skipif mysql # not compatible

query I rowsort label-6967
SELECT - COALESCE ( ( 53 ), COUNT ( * ), - NULLIF ( - SUM ( DISTINCT - CAST ( NULL AS INTEGER ) ), CASE - col0 WHEN COUNT ( * ) / - ( - col1 ) THEN - col2 - col0 ELSE - COALESCE ( col0, + 78 + + ( col2 ) * ( col0 ) ) * - col2 END ) ) FROM tab2 AS cor0 WHERE NOT - ( + ( col1 ) ) - + - col2 + col2 + - col2 + + - col2 * 74 + - col0 IS NOT NULL GROUP BY col0, col1
----

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

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6975
SELECT COALESCE ( - - 33, + ( + col2 ) * - + col1 * + + col0 * + - 9 * col1 - - + col1 + col2 * NULLIF ( + col2, - + col1 * CAST( col2 AS SIGNED ) ) ) * - - 6, + 23 + - col1 + - col1 * + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible

query II rowsort label-6975
SELECT COALESCE ( - - 33, + ( + col2 ) * - + col1 * + + col0 * + - 9 * col1 - - + col1 + col2 * NULLIF ( + col2, - + col1 * CAST ( col2 AS INTEGER ) ) ) * - - 6, + 23 + - col1 + - col1 * + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-6976
SELECT + ( - + COUNT( * ) ) DIV - 83 * - 76 * - col2 - col2, col2 + - - 10 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
................................................................................
NULL
-2337
NULL
-246
NULL

skipif mysql # not compatible

query II rowsort label-7026
SELECT ALL - 41 * col1 col1, 88 + col1 * CAST ( NULL AS REAL ) AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-1804
NULL
-2337
NULL
................................................................................
SELECT CASE - CAST( NULL AS SIGNED ) WHEN - 14 * - col0 + - - 3 + + col1 THEN + + 94 * col2 ELSE NULL END FROM tab0 GROUP BY col1, col0
----
NULL
NULL
NULL

skipif mysql # not compatible

query I rowsort label-7078
SELECT CASE - CAST ( NULL AS INTEGER ) WHEN - 14 * - col0 + - - 3 + + col1 THEN + + 94 * col2 ELSE NULL END FROM tab0 GROUP BY col1, col0
----
NULL
NULL
NULL

................................................................................

query I rowsort
SELECT DISTINCT col1 * 40 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0
3240


query I rowsort
SELECT COALESCE ( + 96, + - col2 * - 1 ) FROM tab2 GROUP BY col1
----
96
96
96

................................................................................
----

skipif mysql # not compatible
query I rowsort label-7203
SELECT DISTINCT - 1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NOT ( COUNT ( * ) IS NOT NULL )
----


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

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7205
SELECT ALL COUNT( * ) + + col2 * + 93 + + + col2 * + col2 + CAST( NULL AS SIGNED ) + + MIN( - col2 ) / + col2 AS col1 FROM tab1 GROUP BY col2, col2
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-7221
SELECT ALL + col0 * + COALESCE ( - - MAX( ALL col1 ), - 55 ) AS col2 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NULL AND NOT ( NULL ) BETWEEN ( - CAST( 96 AS DECIMAL ) ) AND - 45 * CASE COUNT( - 11 ) / - SUM( + col0 ) WHEN 1 THEN - col0 ELSE NULL END - col2
----

skipif mysql # not compatible

query I rowsort label-7221
SELECT ALL + col0 * + COALESCE ( - - MAX ( ALL col1 ), - 55 ) AS col2 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NULL AND NOT ( NULL ) BETWEEN ( - CAST ( 96 AS REAL ) ) AND - 45 * CASE COUNT ( - 11 ) / - SUM ( + col0 ) WHEN 1 THEN - col0 ELSE NULL END - col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7222
SELECT DISTINCT CAST( NULL AS SIGNED ) * CAST( NULL AS SIGNED ) + + 13 - col0 * + col0 - - ( - 64 ) * col2 + 95 AS col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col1, col0 HAVING NULL NOT BETWEEN - col1 AND NULL
................................................................................
----

skipif mysql # not compatible
query I rowsort label-7237
SELECT col1 FROM tab1 GROUP BY col1 HAVING - - COUNT ( * ) + + col1 + + 13 < + 12
----


query I rowsort
SELECT DISTINCT COALESCE ( - 59, + 39 * + col2 * - 15 ) + + - col0 + + 91 * + - 10 + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-1013
-1025
-1133

................................................................................
skipif mysql # not compatible
query I rowsort label-7321
SELECT ALL + + 51 + - + 36 + - COUNT ( * ) - + 32 FROM tab0 AS cor0 GROUP BY col1
----
-18
-19


query II rowsort
SELECT ALL - col1 col1, ( + - col1 ) AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
-81
0
0
................................................................................
SELECT + COALESCE ( - 31, + - col0 DIV - col1 + + col1, - 64, CAST( NULL AS SIGNED ) ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-31
-31
-31

skipif mysql # not compatible

query I rowsort label-7356
SELECT + COALESCE ( - 31, + - col0 / - col1 + + col1, - 64, CAST ( NULL AS INTEGER ) ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-31
-31
-31

................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7477
SELECT ALL col2 - col2 * COALESCE ( + 54, - col1 * CAST( - - 33 AS SIGNED ) * - col0 * - col2 + - - 55 - - 27 + MAX( - col0 ) + + - CAST( NULL AS SIGNED ) / - + COALESCE ( col1, col0 + - col2, + NULLIF ( col1, + NULLIF ( 19, 46 / 46 ) ) * ( 63 ) ) + col2, + 51 ) + MIN( DISTINCT col2 ) AS col1 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL NOT BETWEEN ( col1 + COUNT( * ) ) AND NULL
----

skipif mysql # not compatible

query I rowsort label-7477
SELECT ALL col2 - col2 * COALESCE ( + 54, - col1 * CAST ( - - 33 AS INTEGER ) * - col0 * - col2 + - - 55 - - 27 + MAX ( - col0 ) + + - CAST ( NULL AS INTEGER ) / - + COALESCE ( col1, col0 + - col2, + NULLIF ( col1, + NULLIF ( 19, 46 / 46 ) ) * ( 63 ) ) + col2, + 51 ) + MIN ( DISTINCT col2 ) AS col1 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL NOT BETWEEN ( col1 + COUNT ( * ) ) AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7478
SELECT - col2 + - COUNT( ( 65 ) ) + + col0 + col2 * - + col0 FROM tab2 GROUP BY col0, col2
................................................................................
-1694
-28
-2156
-82
-6314

skipif mysql # not compatible

query II rowsort label-7532
SELECT - col0 col2, - col0 * - NULLIF ( - COALESCE ( 77, 7 ), col0 + - CAST ( NULL AS INTEGER ) ) AS col2 FROM tab1 GROUP BY col2, col0
----
-22
-1694
-28
-2156
................................................................................
query I rowsort
SELECT - col1 FROM tab1 AS cor0 WHERE + col2 IS NOT NULL GROUP BY col1
----
-44
-57
-6


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

query I rowsort
SELECT - col2 AS col2 FROM tab0 cor0 GROUP BY col1, col2
----
................................................................................
70
41
70
59
70
61


query II rowsort
SELECT ALL + col2 col2, 55 AS col0 FROM tab0 AS cor0 GROUP BY col2
----
24
55
38
55
................................................................................

onlyif mysql # aggregate syntax: 
query II rowsort label-7626
SELECT col1 col1, + col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT + COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible

query II rowsort label-7626
SELECT col1 col1, + col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT + COUNT ( * ) IS NOT NULL
----

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

query I rowsort
SELECT 45 * + + col1 + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NULL <= - 98 + - 30 * 48
----


query II rowsort
SELECT - col1 + - + col1 col0, col1 - - col1 * col1 AS col2 FROM tab2 GROUP BY col1
----
-118
3540
-122
3782
................................................................................
----

skipif mysql # not compatible
query I rowsort label-7736
SELECT DISTINCT ( + - SUM ( DISTINCT - + 34 ) ) * + col0 / - + col1 * + COUNT ( - 53 ) + - COUNT ( ( - col1 ) + col1 ) FROM tab1 AS cor0 WHERE NOT - col2 + + - 16 + + col2 + - col0 >= col0 GROUP BY col0, col1 HAVING NOT + 56 - - SUM ( + col2 ) <= NULL
----


query II rowsort
SELECT DISTINCT - col0 col2, - 18 * + + col0 - - 77 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
-15
-193
-91
-1561
................................................................................
onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7773
SELECT DISTINCT + 26 / + + COUNT( * ) * - ( - + CAST( NULL AS SIGNED ) ) * + col2 + + CAST( NULL AS SIGNED ) * COALESCE ( + 19, - col2 + + col0 ) + - col2 FROM tab0 GROUP BY col2
----
NULL

skipif mysql # not compatible

query I rowsort label-7773
SELECT DISTINCT + 26 / + + COUNT ( * ) * - ( - + CAST ( NULL AS INTEGER ) ) * + col2 + + CAST ( NULL AS INTEGER ) * COALESCE ( + 19, - col2 + + col0 ) + - col2 FROM tab0 GROUP BY col2
----
NULL

onlyif mysql # DIV for integer division: 
query II rowsort label-7774
................................................................................
-71
-8

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


query II rowsort
SELECT + 54 * + col1 * col1 col1, - 5 + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col1 IS NULL
----
104544
39
175446
52
................................................................................
SELECT COALESCE ( - 54, + 91 + ( - - col1 ) * + 25 DIV + col2 * col2 - - + 77 ) FROM tab1 GROUP BY col0
----
-54
-54
-54

skipif mysql # not compatible

query I rowsort label-7829
SELECT COALESCE ( - 54, + 91 + ( - - col1 ) * + 25 / + col2 * col2 - - + 77 ) FROM tab1 GROUP BY col0
----
-54
-54
-54

onlyif mysql # aggregate syntax: 
query II rowsort label-7830
SELECT ALL + col1 col1, col1 + - 1 * - + COUNT( * ) * + + MIN( + col1 ) AS col1 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) > - 86
----

skipif mysql # not compatible

query II rowsort label-7830
SELECT ALL + col1 col1, col1 + - 1 * - + COUNT ( * ) * + + MIN ( + col1 ) AS col1 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) > - 86
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7831
SELECT DISTINCT - + COUNT( * ) AS col0 FROM tab1 AS cor0 GROUP BY col1
................................................................................

skipif mysql # not compatible
query I rowsort label-7839
SELECT DISTINCT + ( + col0 ) * - col0 / - CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) + 3 * + - col0 * - col0 AS col0 FROM tab1 GROUP BY col0
----
NULL


query II rowsort
SELECT ALL col0 * - - ( ( - + 20 ) ) * + COALESCE ( + 88, + + col2 ) + col0, col0 AS col2 FROM tab1 GROUP BY col0
----
-144238
82
-38698
22
................................................................................
SELECT COALESCE ( - + 20, COUNT( * ) + - CASE + col0 WHEN col2 * + NULLIF ( NULLIF ( COALESCE ( - col1, 62 * - 42 ), 41 * col2 ), + CAST( - col1 AS SIGNED ) * MIN( CAST( NULL AS SIGNED ) + CASE col2 WHEN 81 + col1 THEN + col1 END ) ) * - col0 + COUNT( * ) THEN NULL WHEN + CAST( - ( + CAST( COUNT( * ) AS SIGNED ) ) AS SIGNED ) * - 99 THEN 66 ELSE NULL END + + col1 ) FROM tab0 GROUP BY col2, col1
----
-20
-20
-20

skipif mysql # not compatible

query I rowsort label-7984
SELECT COALESCE ( - + 20, COUNT ( * ) + - CASE + col0 WHEN col2 * + NULLIF ( NULLIF ( COALESCE ( - col1, 62 * - 42 ), 41 * col2 ), + CAST ( - col1 AS INTEGER ) * MIN ( CAST ( NULL AS INTEGER ) + CASE col2 WHEN 81 + col1 THEN + col1 END ) ) * - col0 + COUNT ( * ) THEN NULL WHEN + CAST ( - ( + CAST ( COUNT ( * ) AS INTEGER ) ) AS INTEGER ) * - 99 THEN 66 ELSE NULL END + + col1 ) FROM tab0 GROUP BY col2, col1
----
-20
-20
-20

................................................................................
-22
90
-28
90
-82

skipif mysql # not compatible

query II rowsort label-8034
SELECT + 90 col1, + ( + MIN ( ALL - + col0 ) ) FROM tab1 cor0 GROUP BY col1, col1, col0
----
90
-22
90
-28
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-8106
SELECT DISTINCT - 33 + + col2 * MAX( 25 ), - col1 + + col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING + col1 - CASE + col0 WHEN - col0 * + 10 THEN CASE + CASE WHEN col1 > col1 * + col2 + 78 * + 17 + - + col2 THEN NULL ELSE + COUNT( * ) END WHEN + - col1 * - col0 THEN - COUNT( DISTINCT + col1 ) * - COALESCE ( - 43, + COUNT( * ), + + col1 ) / - + AVG ( + - col0 ) ELSE + - 74 + col2 / - CAST( NULL AS SIGNED ) END * col2 + + col2 ELSE - 58 * + 40 + col2 END >= ( NULL )
----

skipif mysql # not compatible

query II rowsort label-8106
SELECT DISTINCT - 33 + + col2 * MAX ( 25 ), - col1 + + col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING + col1 - CASE + col0 WHEN - col0 * + 10 THEN CASE + CASE WHEN col1 > col1 * + col2 + 78 * + 17 + - + col2 THEN NULL ELSE + COUNT ( * ) END WHEN + - col1 * - col0 THEN - COUNT ( DISTINCT + col1 ) * - COALESCE ( - 43, + COUNT ( * ), + + col1 ) / - + AVG ( + - col0 ) ELSE + - 74 + col2 / - CAST ( NULL AS INTEGER ) END * col2 + + col2 ELSE - 58 * + 40 + col2 END >= ( NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8107
SELECT + - COUNT( * ) FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( NULL ) = NULL
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-8132
SELECT ALL - MAX( DISTINCT + + col1 ) - + col1 * + - col1 + + col1 * + col1 * - COALESCE ( - 89, - + col1 * - + col2, + - NULLIF ( + COUNT( 65 ), + 21 + + col1 ) * - - col2 + col0 ) FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible

query I rowsort label-8132
SELECT ALL - MAX ( DISTINCT + + col1 ) - + col1 * + - col1 + + col1 * + col1 * - COALESCE ( - 89, - + col1 * - + col2, + - NULLIF ( + COUNT ( 65 ), + 21 + + col1 ) * - - col2 + col0 ) FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + 22 * - col0 / - col2 AS col0 FROM tab0 GROUP BY col0, col0, col2 HAVING NOT + col0 * col0 * col2 + 78 > NULL
----
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8249
SELECT + NULLIF ( - - ( - CAST( NULL AS SIGNED ) ), + col1 + col0 * - 14 * + CAST( + COUNT( * ) AS SIGNED ) ) + + - MIN( + col1 ) + + col1 FROM tab0 GROUP BY col1 HAVING NOT + 0 IS NOT NULL
----

skipif mysql # not compatible

query I rowsort label-8249
SELECT + NULLIF ( - - ( - CAST ( NULL AS INTEGER ) ), + col1 + col0 * - 14 * + CAST ( + COUNT ( * ) AS INTEGER ) ) + + - MIN ( + col1 ) + + col1 FROM tab0 GROUP BY col1 HAVING NOT + 0 IS NOT NULL
----

query I rowsort
SELECT + - ( - + col1 ) + + + 0 * - col1 * - 16 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
................................................................................
SELECT + NULLIF ( - ( CAST( NULL AS SIGNED ) ), - + col2 ) + + col1 - ( - col1 ) FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL
NULL
NULL

skipif mysql # not compatible

query I rowsort label-8258
SELECT + NULLIF ( - ( CAST ( NULL AS INTEGER ) ), - + col2 ) + + col1 - ( - col1 ) FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL
NULL
NULL

................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DECIMAL type: 
query I rowsort label-8317
SELECT ALL CASE - col0 WHEN 57 * SUM( - + col0 ) THEN NULL WHEN - - 91 THEN - col1 ELSE NULL END AS col2 FROM tab2 GROUP BY col1, col0 HAVING NOT + 6 * + - col0 + CAST( + COUNT( * ) AS DECIMAL ) * - col2 >= - - CAST( NULL AS SIGNED )
----

skipif mysql # not compatible

query I rowsort label-8317
SELECT ALL CASE - col0 WHEN 57 * SUM ( - + col0 ) THEN NULL WHEN - - 91 THEN - col1 ELSE NULL END AS col2 FROM tab2 GROUP BY col1, col0 HAVING NOT + 6 * + - col0 + CAST ( + COUNT ( * ) AS REAL ) * - col2 >= - - CAST ( NULL AS INTEGER )
----

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

skipif mysql # not compatible
query II rowsort label-8338
SELECT + col2 AS col1, 16 * - MAX ( ALL - col2 ) * + + col2 * + - ( - - 16 ) AS col1 FROM tab2 WHERE NOT + CASE - col1 WHEN - ( + 14 ) THEN + 99 END IS NOT NULL GROUP BY col2 HAVING NOT ( NULL ) = - 22 + + col2
----


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

onlyif mysql # aggregate syntax: 
query I rowsort label-8340
SELECT MAX( 60 ) * + SUM( - + col1 ) + - col1 + + COUNT( * ) AS col0 FROM tab0 GROUP BY col1
................................................................................
13

query I rowsort
SELECT DISTINCT - 5 AS col0 FROM tab1 GROUP BY col2, col2
----
-5


query II rowsort
SELECT col0 col0, + 6 FROM tab0 GROUP BY col0 HAVING NOT 84 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8393
SELECT DISTINCT CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) * + col2 FROM tab2 GROUP BY col2
................................................................................
1
-59
1
-61
1

skipif mysql # not compatible

query II rowsort label-8404
SELECT ALL - col1 col1, + COUNT ( * ) FROM tab2 AS cor0 GROUP BY col1
----
-41
1
-59
1
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8428
SELECT + COALESCE ( + - 66, col0 + 1 + - - col1 ) + + CAST( + COUNT( * ) AS SIGNED ) + - 64 + + + 20 * - col1 + - - COUNT( DISTINCT + col1 ) * - col1 / COUNT( * ) * - col1 / 8 FROM tab0 WHERE NOT - - col0 IS NOT NULL GROUP BY col1 HAVING NULL <> NULL
----

skipif mysql # not compatible

query I rowsort label-8428
SELECT + COALESCE ( + - 66, col0 + 1 + - - col1 ) + + CAST ( + COUNT ( * ) AS INTEGER ) + - 64 + + + 20 * - col1 + - - COUNT ( DISTINCT + col1 ) * - col1 / COUNT ( * ) * - col1 / 8 FROM tab0 WHERE NOT - - col0 IS NOT NULL GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT - col2 FROM tab2 WHERE NOT + - 1 IS NULL GROUP BY col2
----
................................................................................
SELECT + 87 / col2 / col2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

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


query I rowsort
SELECT + 16 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT ( + 53 ) BETWEEN + col2 * + col1 AND 22
----
16
16
16

................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-8503
SELECT DISTINCT - + 1 * COALESCE ( - 46, - + COUNT( * ) ) / 79 + col2 - - col2 / AVG ( ALL - + 1 ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING COUNT( * ) * - col1 = NULL
----

skipif mysql # not compatible

query I rowsort label-8503
SELECT DISTINCT - + 1 * COALESCE ( - 46, - + COUNT ( * ) ) / 79 + col2 - - col2 / AVG ( ALL - + 1 ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING COUNT ( * ) * - col1 = NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8504
SELECT ALL - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING - COUNT( * ) NOT IN ( - COUNT( * ), 88, COUNT( * ) )
................................................................................
SELECT ALL - + CASE + 33 WHEN - - 67 THEN col0 ELSE - CAST( - col1 AS SIGNED ) END * - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
2565
3124
48

skipif mysql # not compatible

query I rowsort label-8518
SELECT ALL - + CASE + 33 WHEN - - 67 THEN col0 ELSE - CAST ( - col1 AS INTEGER ) END * - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
2565
3124
48

................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8529
SELECT + col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NULL <> - - CAST( + + col1 AS SIGNED ) + 42 + - col1 + - 16
----

skipif mysql # not compatible

query I rowsort label-8529
SELECT + col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NULL <> - - CAST ( + + col1 AS INTEGER ) + 42 + - col1 + - 16
----

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

onlyif mysql # aggregate syntax: 
query II rowsort label-8593
SELECT ALL + col1 col1, - col1 AS col2 FROM tab1 WHERE NOT NULL < NULL GROUP BY col1 HAVING NOT + COUNT( * ) NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible

query II rowsort label-8593
SELECT ALL + col1 col1, - col1 AS col2 FROM tab1 WHERE NOT NULL < NULL GROUP BY col1 HAVING NOT + COUNT ( * ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 * + 40 AS col1 FROM tab1 GROUP BY col2
----
................................................................................

onlyif mysql # aggregate syntax: 
query II rowsort label-8622
SELECT DISTINCT col0 + col1 col0, - ( 71 ) + + COUNT( * ) * col0 * + + ( + 33 ) FROM tab2 GROUP BY col1, col0 HAVING ( NULL ) IS NOT NULL
----

skipif mysql # not compatible

query II rowsort label-8622
SELECT DISTINCT col0 + col1 col0, - ( 71 ) + + COUNT ( * ) * col0 * + + ( + 33 ) FROM tab2 GROUP BY col1, col0 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-8623
SELECT + COUNT( * ) DIV + - 99 - COUNT( * ) FROM tab1 AS cor0 GROUP BY col2
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-8660
SELECT DISTINCT - 54 AS col2 FROM tab0 GROUP BY col0 HAVING NULL BETWEEN ( ( - col2 ) ) * - - COUNT( * ) AND - - 79
----

skipif mysql # not compatible

query I rowsort label-8660
SELECT DISTINCT - 54 AS col2 FROM tab0 GROUP BY col0 HAVING NULL BETWEEN ( ( - col2 ) ) * - - COUNT ( * ) AND - - 79
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8661
SELECT ALL col0 DIV col0 * - - col0 * col0 AS col0 FROM tab2 GROUP BY col0
................................................................................
query I rowsort
SELECT + 69 FROM tab1 GROUP BY col0
----
69
69
69


query I rowsort
SELECT DISTINCT + COALESCE ( + 60, - + col1, + col2 ) FROM tab1 AS cor0 GROUP BY col2
----
60

query I rowsort
SELECT + 37 FROM tab2 AS cor0 GROUP BY col1, col1
................................................................................
query I rowsort
SELECT DISTINCT 39 + + col2 FROM tab1 GROUP BY tab1.col2
----
110
47
84


query I rowsort
SELECT - COALESCE ( + 26, + cor0.col2 + cor0.col0 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
-26
-26
-26

................................................................................
4

query I rowsort
SELECT DISTINCT + 59 FROM tab2 cor0 GROUP BY cor0.col0
----
59


query I rowsort
SELECT - COALESCE ( + 80, col0 ) * + cor0.col1 FROM tab2 cor0 GROUP BY cor0.col2, cor0.col1
----
-3280
-4720
-4880








>







 







>







 







>







 







>







 







>







 







>







 







>







 







>












>







 







>










>







 







>







 







>







 







>







 







>







>




>







 







>







 







>










>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







>







 







>







 







>







 







>










>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>










>







 







>







 







>







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>










>







 







>







 







>







 







>







 







>













>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>













>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
...
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
....
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
....
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
....
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
....
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
....
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
....
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
....
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
....
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
....
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
....
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
....
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
....
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
....
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
....
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
....
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
....
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
....
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
....
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
....
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
....
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
....
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
....
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
....
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
....
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
....
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
.....
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
.....
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
.....
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
.....
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
.....
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
.....
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
.....
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
.....
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
.....
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
.....
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
.....
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
.....
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
.....
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
.....
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
.....
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
.....
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
.....
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
.....
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
.....
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
.....
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
.....
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
.....
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
.....
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
.....
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
.....
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
.....
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
.....
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
.....
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
.....
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
.....
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
.....
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
.....
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
.....
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
.....
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
.....
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
.....
22225
22226
22227
22228
22229
22230
22231
22232
22233
22234
22235
22236
22237
22238
22239
.....
22377
22378
22379
22380
22381
22382
22383
22384
22385
22386
22387
22388
22389
22390
22391
.....
22590
22591
22592
22593
22594
22595
22596
22597
22598
22599
22600
22601
22602
22603
22604
.....
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048
23049
23050
23051
23052
.....
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
.....
23828
23829
23830
23831
23832
23833
23834
23835
23836
23837
23838
23839
23840
23841
23842
.....
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
.....
24735
24736
24737
24738
24739
24740
24741
24742
24743
24744
24745
24746
24747
24748
24749
.....
24878
24879
24880
24881
24882
24883
24884
24885
24886
24887
24888
24889
24890
24891
24892
.....
25401
25402
25403
25404
25405
25406
25407
25408
25409
25410
25411
25412
25413
25414
25415
.....
25995
25996
25997
25998
25999
26000
26001
26002
26003
26004
26005
26006
26007
26008
26009
.....
26318
26319
26320
26321
26322
26323
26324
26325
26326
26327
26328
26329
26330
26331
26332
.....
26936
26937
26938
26939
26940
26941
26942
26943
26944
26945
26946
26947
26948
26949
26950
.....
27605
27606
27607
27608
27609
27610
27611
27612
27613
27614
27615
27616
27617
27618
27619
.....
27828
27829
27830
27831
27832
27833
27834
27835
27836
27837
27838
27839
27840
27841
27842
.....
29151
29152
29153
29154
29155
29156
29157
29158
29159
29160
29161
29162
29163
29164
29165
.....
29569
29570
29571
29572
29573
29574
29575
29576
29577
29578
29579
29580
29581
29582
29583
.....
29780
29781
29782
29783
29784
29785
29786
29787
29788
29789
29790
29791
29792
29793
29794
.....
30492
30493
30494
30495
30496
30497
30498
30499
30500
30501
30502
30503
30504
30505
30506
.....
31809
31810
31811
31812
31813
31814
31815
31816
31817
31818
31819
31820
31821
31822
31823
.....
32091
32092
32093
32094
32095
32096
32097
32098
32099
32100
32101
32102
32103
32104
32105
.....
32581
32582
32583
32584
32585
32586
32587
32588
32589
32590
32591
32592
32593
32594
32595
.....
32985
32986
32987
32988
32989
32990
32991
32992
32993
32994
32995
32996
32997
32998
32999
.....
33061
33062
33063
33064
33065
33066
33067
33068
33069
33070
33071
33072
33073
33074
33075
.....
33158
33159
33160
33161
33162
33163
33164
33165
33166
33167
33168
33169
33170
33171
33172
.....
33258
33259
33260
33261
33262
33263
33264
33265
33266
33267
33268
33269
33270
33271
33272
.....
33397
33398
33399
33400
33401
33402
33403
33404
33405
33406
33407
33408
33409
33410
33411
.....
33649
33650
33651
33652
33653
33654
33655
33656
33657
33658
33659
33660
33661
33662
33663
.....
33962
33963
33964
33965
33966
33967
33968
33969
33970
33971
33972
33973
33974
33975
33976
.....
34598
34599
34600
34601
34602
34603
34604
34605
34606
34607
34608
34609
34610
34611
34612
.....
35612
35613
35614
35615
35616
35617
35618
35619
35620
35621
35622
35623
35624
35625
35626
.....
35811
35812
35813
35814
35815
35816
35817
35818
35819
35820
35821
35822
35823
35824
35825
.....
35972
35973
35974
35975
35976
35977
35978
35979
35980
35981
35982
35983
35984
35985
35986
.....
36035
36036
36037
36038
36039
36040
36041
36042
36043
36044
36045
36046
36047
36048
36049
.....
36328
36329
36330
36331
36332
36333
36334
36335
36336
36337
36338
36339
36340
36341
36342
.....
36891
36892
36893
36894
36895
36896
36897
36898
36899
36900
36901
36902
36903
36904
36905
.....
37423
37424
37425
37426
37427
37428
37429
37430
37431
37432
37433
37434
37435
37436
37437
.....
37888
37889
37890
37891
37892
37893
37894
37895
37896
37897
37898
37899
37900
37901
37902
.....
37919
37920
37921
37922
37923
37924
37925
37926
37927
37928
37929
37930
37931
37932
37933
.....
38139
38140
38141
38142
38143
38144
38145
38146
38147
38148
38149
38150
38151
38152
38153
.....
38183
38184
38185
38186
38187
38188
38189
38190
38191
38192
38193
38194
38195
38196
38197
.....
38844
38845
38846
38847
38848
38849
38850
38851
38852
38853
38854
38855
38856
38857
38858
.....
39014
39015
39016
39017
39018
39019
39020
39021
39022
39023
39024
39025
39026
39027
39028
.....
39112
39113
39114
39115
39116
39117
39118
39119
39120
39121
39122
39123
39124
39125
39126
.....
40013
40014
40015
40016
40017
40018
40019
40020
40021
40022
40023
40024
40025
40026
40027
.....
40574
40575
40576
40577
40578
40579
40580
40581
40582
40583
40584
40585
40586
40587
40588
.....
40833
40834
40835
40836
40837
40838
40839
40840
40841
40842
40843
40844
40845
40846
40847
.....
40876
40877
40878
40879
40880
40881
40882
40883
40884
40885
40886
40887
40888
40889
40890
.....
41452
41453
41454
41455
41456
41457
41458
41459
41460
41461
41462
41463
41464
41465
41466
.....
41479
41480
41481
41482
41483
41484
41485
41486
41487
41488
41489
41490
41491
41492
41493
.....
42171
42172
42173
42174
42175
42176
42177
42178
42179
42180
42181
42182
42183
42184
42185
.....
43206
43207
43208
43209
43210
43211
43212
43213
43214
43215
43216
43217
43218
43219
43220
.....
43421
43422
43423
43424
43425
43426
43427
43428
43429
43430
43431
43432
43433
43434
43435
.....
44320
44321
44322
44323
44324
44325
44326
44327
44328
44329
44330
44331
44332
44333
44334
.....
44338
44339
44340
44341
44342
44343
44344
44345
44346
44347
44348
44349
44350
44351
44352
.....
44751
44752
44753
44754
44755
44756
44757
44758
44759
44760
44761
44762
44763
44764
44765
.....
45062
45063
45064
45065
45066
45067
45068
45069
45070
45071
45072
45073
45074
45075
45076
.....
45102
45103
45104
45105
45106
45107
45108
45109
45110
45111
45112
45113
45114
45115
45116
.....
45315
45316
45317
45318
45319
45320
45321
45322
45323
45324
45325
45326
45327
45328
45329
45330
45331
45332
45333
45334
45335
45336
45337
45338
45339
45340
.....
45388
45389
45390
45391
45392
45393
45394
45395
45396
45397
45398
45399
45400
45401
45402
.....
45761
45762
45763
45764
45765
45766
45767
45768
45769
45770
45771
45772
45773
45774
45775
45776
45777
45778
45779
45780
45781
45782
45783
.....
45972
45973
45974
45975
45976
45977
45978
45979
45980
45981
45982
45983
45984
45985
45986
.....
46253
46254
46255
46256
46257
46258
46259
46260
46261
46262
46263
46264
46265
46266
46267
.....
46620
46621
46622
46623
46624
46625
46626
46627
46628
46629
46630
46631
46632
46633
46634
.....
46700
46701
46702
46703
46704
46705
46706
46707
46708
46709
46710
46711
46712
46713
46714
.....
47329
47330
47331
47332
47333
47334
47335
47336
47337
47338
47339
47340
47341
47342
47343
.....
48502
48503
48504
48505
48506
48507
48508
48509
48510
48511
48512
48513
48514
48515
48516
.....
48630
48631
48632
48633
48634
48635
48636
48637
48638
48639
48640
48641
48642
48643
48644
.....
48866
48867
48868
48869
48870
48871
48872
48873
48874
48875
48876
48877
48878
48879
48880
.....
48949
48950
48951
48952
48953
48954
48955
48956
48957
48958
48959
48960
48961
48962
48963
.....
49012
49013
49014
49015
49016
49017
49018
49019
49020
49021
49022
49023
49024
49025
49026
.....
49107
49108
49109
49110
49111
49112
49113
49114
49115
49116
49117
49118
49119
49120
49121
.....
49247
49248
49249
49250
49251
49252
49253
49254
49255
49256
49257
49258
49259
49260
49261
.....
49294
49295
49296
49297
49298
49299
49300
49301
49302
49303
49304
49305
49306
49307
49308
.....
49624
49625
49626
49627
49628
49629
49630
49631
49632
49633
49634
49635
49636
49637
49638
.....
49767
49768
49769
49770
49771
49772
49773
49774
49775
49776
49777
49778
49779
49780
49781
.....
49836
49837
49838
49839
49840
49841
49842
49843
49844
49845
49846
49847
49848
49849
49850
.....
50484
50485
50486
50487
50488
50489
50490
50491
50492
50493
50494
50495
50496
50497
50498
.....
50525
50526
50527
50528
50529
50530
50531
50532
50533
50534
50535
50536
50537
50538
50539
.....
50657
50658
50659
50660
50661
50662
50663
50664
50665
50666
50667
50668
50669
50670
50671
.....
50793
50794
50795
50796
50797
50798
50799
50800
50801
50802
50803
50804
50805
50806
50807
.....
50829
50830
50831
50832
50833
50834
50835
50836
50837
50838
50839
50840
50841
50842
50843
.....
50991
50992
50993
50994
50995
50996
50997
50998
50999
51000
51001
51002
51003
51004
51005
51006
51007
51008
51009
51010
51011
51012
51013
51014
51015
51016
.....
51581
51582
51583
51584
51585
51586
51587
51588
51589
51590
51591
51592
51593
51594
51595
.....
51642
51643
51644
51645
51646
51647
51648
51649
51650
51651
51652
51653
51654
51655
51656
.....
52791
52792
52793
52794
52795
52796
52797
52798
52799
52800
52801
52802
52803
52804
52805
.....
53340
53341
53342
53343
53344
53345
53346
53347
53348
53349
53350
53351
53352
53353
53354
53355
53356
53357
53358
53359
53360
53361
53362
53363
53364
53365
53366
53367
53368
.....
53603
53604
53605
53606
53607
53608
53609
53610
53611
53612
53613
53614
53615
53616
53617
.....
53752
53753
53754
53755
53756
53757
53758
53759
53760
53761
53762
53763
53764
53765
53766
.....
53792
53793
53794
53795
53796
53797
53798
53799
53800
53801
53802
53803
53804
53805
53806
.....
54153
54154
54155
54156
54157
54158
54159
54160
54161
54162
54163
54164
54165
54166
54167
.....
54276
54277
54278
54279
54280
54281
54282
54283
54284
54285
54286
54287
54288
54289
54290
.....
54958
54959
54960
54961
54962
54963
54964
54965
54966
54967
54968
54969
54970
54971
54972
.....
55142
55143
55144
55145
55146
55147
55148
55149
55150
55151
55152
55153
55154
55155
55156
.....
55606
55607
55608
55609
55610
55611
55612
55613
55614
55615
55616
55617
55618
55619
55620
.....
56184
56185
56186
56187
56188
56189
56190
56191
56192
56193
56194
56195
56196
56197
56198
.....
56413
56414
56415
56416
56417
56418
56419
56420
56421
56422
56423
56424
56425
56426
56427
.....
56473
56474
56475
56476
56477
56478
56479
56480
56481
56482
56483
56484
56485
56486
56487
.....
56765
56766
56767
56768
56769
56770
56771
56772
56773
56774
56775
56776
56777
56778
56779
.....
56826
56827
56828
56829
56830
56831
56832
56833
56834
56835
56836
56837
56838
56839
56840
.....
57347
57348
57349
57350
57351
57352
57353
57354
57355
57356
57357
57358
57359
57360
57361
.....
57824
57825
57826
57827
57828
57829
57830
57831
57832
57833
57834
57835
57836
57837
57838
.....
58749
58750
58751
58752
58753
58754
58755
58756
58757
58758
58759
58760
58761
58762
58763
.....
59024
59025
59026
59027
59028
59029
59030
59031
59032
59033
59034
59035
59036
59037
59038
.....
59192
59193
59194
59195
59196
59197
59198
59199
59200
59201
59202
59203
59204
59205
59206
.....
59376
59377
59378
59379
59380
59381
59382
59383
59384
59385
59386
59387
59388
59389
59390
.....
60228
60229
60230
60231
60232
60233
60234
60235
60236
60237
60238
60239
60240
60241
60242
.....
60551
60552
60553
60554
60555
60556
60557
60558
60559
60560
60561
60562
60563
60564
60565
.....
61633
61634
61635
61636
61637
61638
61639
61640
61641
61642
61643
61644
61645
61646
61647
.....
62088
62089
62090
62091
62092
62093
62094
62095
62096
62097
62098
62099
62100
62101
62102
.....
62136
62137
62138
62139
62140
62141
62142
62143
62144
62145
62146
62147
62148
62149
62150
.....
62904
62905
62906
62907
62908
62909
62910
62911
62912
62913
62914
62915
62916
62917
62918
.....
63018
63019
63020
63021
63022
63023
63024
63025
63026
63027
63028
63029
63030
63031
63032
.....
63570
63571
63572
63573
63574
63575
63576
63577
63578
63579
63580
63581
63582
63583
63584
.....
64051
64052
64053
64054
64055
64056
64057
64058
64059
64060
64061
64062
64063
64064
64065
.....
64363
64364
64365
64366
64367
64368
64369
64370
64371
64372
64373
64374
64375
64376
64377
.....
64667
64668
64669
64670
64671
64672
64673
64674
64675
64676
64677
64678
64679
64680
64681
.....
64916
64917
64918
64919
64920
64921
64922
64923
64924
64925
64926
64927
64928
64929
64930
64931
64932
64933
64934
64935
64936
64937
64938
64939
64940
64941
64942
64943
64944
.....
65024
65025
65026
65027
65028
65029
65030
65031
65032
65033
65034
65035
65036
65037
65038
.....
66473
66474
66475
66476
66477
66478
66479
66480
66481
66482
66483
66484
66485
66486
66487
.....
66915
66916
66917
66918
66919
66920
66921
66922
66923
66924
66925
66926
66927
66928
66929
.....
67613
67614
67615
67616
67617
67618
67619
67620
67621
67622
67623
67624
67625
67626
67627
.....
67854
67855
67856
67857
67858
67859
67860
67861
67862
67863
67864
67865
67866
67867
67868
.....
68901
68902
68903
68904
68905
68906
68907
68908
68909
68910
68911
68912
68913
68914
68915
.....
68978
68979
68980
68981
68982
68983
68984
68985
68986
68987
68988
68989
68990
68991
68992
.....
69523
69524
69525
69526
69527
69528
69529
69530
69531
69532
69533
69534
69535
69536
69537
.....
69728
69729
69730
69731
69732
69733
69734
69735
69736
69737
69738
69739
69740
69741
69742
.....
70217
70218
70219
70220
70221
70222
70223
70224
70225
70226
70227
70228
70229
70230
70231
.....
70335
70336
70337
70338
70339
70340
70341
70342
70343
70344
70345
70346
70347
70348
70349
.....
70564
70565
70566
70567
70568
70569
70570
70571
70572
70573
70574
70575
70576
70577
70578
.....
70876
70877
70878
70879
70880
70881
70882
70883
70884
70885
70886
70887
70888
70889
70890
.....
71183
71184
71185
71186
71187
71188
71189
71190
71191
71192
71193
71194
71195
71196
71197
.....
71370
71371
71372
71373
71374
71375
71376
71377
71378
71379
71380
71381
71382
71383
71384
.....
71509
71510
71511
71512
71513
71514
71515
71516
71517
71518
71519
71520
71521
71522
71523
.....
72128
72129
72130
72131
72132
72133
72134
72135
72136
72137
72138
72139
72140
72141
72142
.....
72423
72424
72425
72426
72427
72428
72429
72430
72431
72432
72433
72434
72435
72436
72437
.....
72809
72810
72811
72812
72813
72814
72815
72816
72817
72818
72819
72820
72821
72822
72823
.....
72968
72969
72970
72971
72972
72973
72974
72975
72976
72977
72978
72979
72980
72981
72982
.....
77447
77448
77449
77450
77451
77452
77453
77454
77455
77456
77457
77458
77459
77460
77461
.....
78779
78780
78781
78782
78783
78784
78785
78786
78787
78788
78789
78790
78791
78792
78793

statement ok
INSERT INTO tab2 VALUES(91,59,79)

statement ok
INSERT INTO tab2 VALUES(92,41,58)

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT CASE + col2 WHEN 61 THEN NULL ELSE + col2 * - + 95 * + 29 END col1 FROM tab2 GROUP BY col2 HAVING NOT ( NULL ) > NULL
----

query I rowsort
SELECT DISTINCT + col1 - + ( col1 ) FROM tab2 GROUP BY col1
----
................................................................................
query I rowsort
SELECT NULLIF ( col2, - col2 ) AS col2 FROM tab0 GROUP BY col2, col2, col0
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col2 + - + ( - 41 ) - - - col1 col1, 7 FROM tab1 cor0 GROUP BY col2, col1
----
29
7
43
7
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-281
SELECT ALL - 29 * - + 95 AS col1 FROM tab0 GROUP BY col0 HAVING + CAST( NULL AS SIGNED ) / ( + 17 ) = - + ( ( - + col1 ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-281
SELECT ALL - 29 * - + 95 AS col1 FROM tab0 GROUP BY col0 HAVING + CAST ( NULL AS INTEGER ) / ( + 17 ) = - + ( ( - + col1 ) )
----

query I rowsort
SELECT + 49 FROM tab2 AS cor0 GROUP BY col2
----
................................................................................
-1403
-943

query I rowsort
SELECT ALL - + 88 + + CASE + col2 WHEN + 75 THEN + col2 END FROM tab0 AS cor0 GROUP BY col2, col2 HAVING ( NULL ) IS NOT NULL
----

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

query I rowsort
SELECT DISTINCT 48 / col0 AS col2 FROM tab1 GROUP BY col0 HAVING NOT col0 NOT BETWEEN + col0 * 96 AND ( NULL )
----
................................................................................
1540
-44
1995
-57
210
-6

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 col1, + 92 + + + col0 AS col2 FROM tab2 cor0 GROUP BY col0
----
-15
107
-91
183
................................................................................
query I rowsort
SELECT DISTINCT col1 AS col0 FROM tab1 GROUP BY col1 HAVING NOT 47 IS NULL
----
44
57
6

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

query I rowsort
SELECT DISTINCT col1 FROM tab2 WHERE NOT ( NULL ) <= col1 GROUP BY col1 HAVING NOT AVG ( + col1 ) IS NULL
----
................................................................................
query I rowsort
SELECT - ( + col0 ) * + - 60 - - + col0 FROM tab2 cor0 GROUP BY col0
----
5551
5612
915

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

query I rowsort
SELECT + col2 * + col2 FROM tab1 cor0 GROUP BY col0, col2
----
................................................................................
----

skipif mysql # not compatible
query I rowsort label-684
SELECT - CAST ( 23 AS INTEGER ) FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) > ( NULL )
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT 81 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT ( NULL ) < 65 / col0 * 39
----

query I rowsort
SELECT ALL - 71 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1 HAVING ( + - 18 + - 34 ) > ( NULL )
----

query I rowsort
SELECT ALL - ( col2 ) AS col0 FROM tab0 AS cor0 WHERE NOT ( col0 * - COALESCE ( col2, + - 75, 11 * col0 ) * col1 + + 58 ) NOT BETWEEN - ( - 33 ) + 99 AND col2 GROUP BY col1, col2
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + - col1 * col1 / ( + - col1 ) - - col1 / col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL = ( + col1 / - ( + col2 ) )
----

onlyif mysql # DIV for integer division: 
query I rowsort label-689
SELECT col1 - + + 42 DIV - 42 - - col1 col1 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING ( - col1 ) IS NOT NULL
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-728
SELECT DISTINCT + 86 * 64 AS col0 FROM tab1 GROUP BY col1 HAVING col0 - + CAST( NULL AS SIGNED ) >= NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-728
SELECT DISTINCT + 86 * 64 AS col0 FROM tab1 GROUP BY col1 HAVING col0 - + CAST ( NULL AS INTEGER ) >= NULL
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-729
SELECT DISTINCT + + AVG ( - ( col0 ) ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( col2 ) >= + CAST( NULL AS DECIMAL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-729
SELECT DISTINCT + + AVG ( - ( col0 ) ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT ( col2 ) >= + CAST ( NULL AS REAL )
----

query I rowsort
SELECT - 58 * col1 FROM tab1 GROUP BY col1
----
................................................................................
----

query I rowsort
SELECT DISTINCT - 79 FROM tab1 GROUP BY col2
----
-79

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

query I rowsort
SELECT DISTINCT - ( - 30 ) + col1 FROM tab1 AS cor0 GROUP BY col1
----
................................................................................
query I rowsort label-793
SELECT DISTINCT - 91 / + + col2 - col1 FROM tab0 GROUP BY col2, col1
----
-1
-2
-84

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col0 col1, col0 FROM tab0 GROUP BY col0, col0
----
-26
26
-43
43
................................................................................
query I rowsort
SELECT ALL - 21 - + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
-27
-65
-78

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL - 70 AS col0, 2 AS col2 FROM tab1 AS cor0 GROUP BY col2 HAVING - ( - - col0 ) <= NULL
----

query I rowsort
SELECT + ( - col1 ) FROM tab1 GROUP BY col1
----
................................................................................
----
53

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + col1 * - col0 * CASE WHEN NULL = + col2 THEN NULL ELSE col0 END + + col1 FROM tab0 AS cor0 GROUP BY col0, col1
----
-149688
0
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( 37, col2 / + col1 ) AS col2 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING ( + col0 ) * - - 4 >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 9 * col2 + col2 + 30 * - col0 col1, col0 + - 1 * + 0 * - ( - col0 ) AS col0 FROM tab1 cor0 GROUP BY col0, col2
----
-1750
82
-390
28
................................................................................
query I rowsort
SELECT ALL - ( - col2 ) FROM tab0 GROUP BY col2
----
24
38
79

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + - 17 * + - 64 col0, + 49 AS col2 FROM tab2 cor0 GROUP BY col1
----
1088
49
1088
49
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-916
SELECT - - 92 * + + CAST( NULL AS SIGNED ) AS col1, ( - - 48 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING - col0 <= NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-916
SELECT - - 92 * + + CAST ( NULL AS INTEGER ) AS col1, ( - - 48 ) AS col0 FROM tab0 AS cor0 GROUP BY col1 HAVING - col0 <= NULL
----

query I rowsort
SELECT - 7 FROM tab0 GROUP BY col1
----
-7
-7

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col1 * - + col1 * + COALESCE ( + - 17, - COALESCE ( - col0, + + col0 * col2 + + + col2 ), - col2 ) - col1 AS col1 FROM tab1 GROUP BY col1, col1 HAVING NULL > NULL
----

query I rowsort
SELECT ALL 43 * + col2 AS col1 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING NULL IS NOT NULL
----
................................................................................
query I rowsort
SELECT + 43 * - col0 + + 68 col0 FROM tab0 AS cor0 GROUP BY col0
----
-1050
-1781
-3501

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col0, col1 + 87 AS col2 FROM tab0 GROUP BY col1, col1 HAVING NULL <> NULL
----

query I rowsort
SELECT - + 2 AS col1 FROM tab2 WHERE NULL >= NULL GROUP BY col2
----
................................................................................
-1
-8

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - + col0 + + col0 col1, col0 AS col2 FROM tab0 cor0 GROUP BY col0, col0
----
0
26
0
43
................................................................................
onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-1034
SELECT DISTINCT - col2 + + col0 + + + NULLIF ( + CAST( NULL AS DECIMAL ), + col0 + - col1 ) FROM tab2 cor0 GROUP BY col0, col2
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-1034
SELECT DISTINCT - col2 + + col0 + + + NULLIF ( + CAST ( NULL AS REAL ), + col0 + - col1 ) FROM tab2 cor0 GROUP BY col0, col2
----
NULL

query I rowsort
SELECT + col1 - 26 FROM tab2 GROUP BY col1, col0 HAVING NULL BETWEEN + CASE - 99 WHEN - - col1 THEN NULL ELSE + 56 END AND 35 * - 64
................................................................................
query I rowsort
SELECT ALL 85 FROM tab0 GROUP BY col0, col0
----
85
85
85

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col0 AS col1 FROM tab0 AS cor0 GROUP BY col0, col0 HAVING ( NOT NULL < - col1 * 9 )
----

query I rowsort
SELECT - 36 FROM tab0 GROUP BY col2, col2 HAVING NULL IS NULL
----
................................................................................
query I rowsort
SELECT DISTINCT - col0 + - 54 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2, col0
----
-137
-80
-97

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( - 30, + col0 ) - 2 FROM tab0 cor0 GROUP BY col2
----
28

query I rowsort
SELECT ALL col1 AS col1 FROM tab2 WHERE ( - 94 ) < col2 GROUP BY col1
................................................................................
-7505
-8265

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT col1 * col1 AS col2 FROM tab0 WHERE NOT ( NULL ) IS NULL GROUP BY col1 HAVING NULL >= col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1099
SELECT DISTINCT CAST( NULL AS SIGNED ) col0 FROM tab1 GROUP BY col2
................................................................................
----

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

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

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

query I rowsort
SELECT ALL + - 85 FROM tab1 AS cor0 GROUP BY col0, col2
----
................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1184
SELECT DISTINCT + - NULLIF ( - CAST( NULL AS SIGNED ), - 74 * + NULLIF ( - - col2, ( - col2 ) ) / + col0 ) FROM tab1 AS cor0 GROUP BY col1, col0
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-1184
SELECT DISTINCT + - NULLIF ( - CAST ( NULL AS INTEGER ), - 74 * + NULLIF ( - - col2, ( - col2 ) ) / + col0 ) FROM tab1 AS cor0 GROUP BY col1, col0
----
NULL

query I rowsort
SELECT DISTINCT 85 FROM tab0 GROUP BY col1, col0
................................................................................
SELECT - 57 + - col2 - + COALESCE ( + 83, + col1 ) + col2 + - CAST( NULL AS SIGNED ) * + 18 * + col2 - - + ( - ( - 90 ) ) FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-1295
SELECT - 57 + - col2 - + COALESCE ( + 83, + col1 ) + col2 + - CAST ( NULL AS INTEGER ) * + 18 * + col2 - - + ( - ( - 90 ) ) FROM tab0 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

................................................................................
NULL
NULL

query II rowsort
SELECT ALL + 56 AS col0, 51 * col1 FROM tab0 GROUP BY col1 HAVING NOT + 30 * + 69 > NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + 50 col2, + col0 * + + 69 * - + col0 * ( + + col0 ) FROM tab2 WHERE NOT NULL IS NULL GROUP BY col0
----

query I rowsort
SELECT 26 * + col2 + - col2 + + - col2 AS col0 FROM tab2 cor0 GROUP BY col2 HAVING ( ( NULL > NULL ) )
----
................................................................................
query I rowsort
SELECT 15 AS col0 FROM tab2 GROUP BY col2
----
15
15
15

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

query I rowsort
SELECT DISTINCT - 22 * + 29 AS col1 FROM tab0 GROUP BY col1
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1375
SELECT DISTINCT + col0 * - col0 - - col0 * - col0 AS col1 FROM tab2 AS cor0 WHERE NOT - CAST( + col0 AS SIGNED ) <> - col1 / + col2 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND + CAST( NULL AS SIGNED ) - col1 / - col0
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-1375
SELECT DISTINCT + col0 * - col0 - - col0 * - col0 AS col1 FROM tab2 AS cor0 WHERE NOT - CAST ( + col0 AS INTEGER ) <> - col1 / + col2 GROUP BY col0 HAVING NOT NULL BETWEEN NULL AND + CAST ( NULL AS INTEGER ) - col1 / - col0
----

query I rowsort
SELECT DISTINCT - 53 FROM tab1 AS cor0 GROUP BY col1, col0, col2
----
................................................................................
30
30

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

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

query II rowsort
SELECT ALL 91 AS col2, + col0 + + 83 AS col2 FROM tab0 AS cor0 GROUP BY col0, col2
----
................................................................................
0
NULL
0
NULL
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-1468
SELECT ALL + 47 + - CAST ( NULL AS INTEGER ) col2, + col0 - col0 FROM tab1 AS cor0 GROUP BY col0
----
NULL
0
NULL
0
................................................................................
query I rowsort
SELECT ALL + 82 + - col1 FROM tab2 GROUP BY col1
----
21
23
41

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 64 * - col0 col1, - ( - - col0 ) AS col0 FROM tab1 GROUP BY col0, col0
----
-1408
-22
-1792
-28
................................................................................
NULL
NULL

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT 40 AS col0 FROM tab1 GROUP BY col1 HAVING ( NULL ) < - col0
----

query I rowsort
SELECT 63 FROM tab1 AS cor0 GROUP BY col0
----
................................................................................
SELECT col0 AS col2 FROM tab1 AS cor0 GROUP BY col0, col0 HAVING NOT 71 <> NULL
----

query I rowsort
SELECT ALL 77 * + 26 AS col1 FROM tab2 GROUP BY col0 HAVING ( NULL ) >= col0 * 57
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col2 * - - COALESCE ( - 89, col1 * NULLIF ( ( 97 ), + col2 * - col2 ), - col2 + col1 ) AS col1 FROM tab0 GROUP BY col2
----
-2136
-3382
-7031

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 * + col0 - + col0 + + col0 + - 14 + col0 col0, col0 FROM tab1 AS cor0 GROUP BY col0
----
492
22
6792
82
................................................................................
query I rowsort
SELECT ALL - col0 FROM tab1 cor0 GROUP BY col0 HAVING - + 91 IS NOT NULL
----
-22
-28
-82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT - col2 / + 34 * - 30 + + 38 AS col0, - 43 FROM tab2 AS cor0 GROUP BY col2 HAVING NULL < 69 * col0
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-1821
SELECT DISTINCT - CASE + - col2 WHEN ( - CAST( NULL AS SIGNED ) ) + - - 76 + + - 56 THEN 53 END AS col2, + col0 FROM tab2 GROUP BY col2, col0
................................................................................
query I rowsort
SELECT ALL 39 FROM tab0 GROUP BY col0, col0
----
39
39
39

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

onlyif mysql # DIV for integer division: 
query I rowsort label-1866
SELECT DISTINCT + - col2 DIV col1 FROM tab1 AS cor0 GROUP BY col2, col1, col0
................................................................................
SELECT col1 AS col0 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NOT NULL IS NULL
----

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col0 AS col1 FROM tab0 GROUP BY col0 HAVING NOT NULL <= - col1 - - col1
----

query I rowsort
SELECT ALL + 58 * 8 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
----
................................................................................
6605

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

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

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

query I rowsort
SELECT DISTINCT 95 * - ( - 56 ) * + ( - + 69 ) FROM tab0 AS cor0 GROUP BY col1
----
-367080

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL ( - COALESCE ( + 57, - col0 * 81 * col1 ) ) FROM tab1 GROUP BY col1
----
-57
-57
-57

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + col1 - col1 * COALESCE ( - + 86, - + col0 * - + col1 + col2, col2 ) - 55 * + - 11 AS col1 FROM tab2 AS cor0 WHERE col1 NOT BETWEEN NULL AND NULL GROUP BY col1 HAVING NOT NULL IS NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT + col1 col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col0 + - + col0 NOT BETWEEN NULL AND NULL
................................................................................
query I rowsort label-1946
SELECT + col1 * 89 - col1 + col1 / - - col0 - 42 FROM tab1 AS cor0 GROUP BY col0, col1
----
3830
486
4976

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

query I rowsort
SELECT ALL 9 * - col2 AS col1 FROM tab0 GROUP BY col2
----
................................................................................
SELECT ALL col0 AS col2 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col1, col0
----

query I rowsort
SELECT ALL + col2 AS col1 FROM tab0 GROUP BY col2, col1, col2 HAVING 32 + ( col2 ) >= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + + 8 col0, col1 + 8 * 91 + + 57 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT 63 * - col1 * + col1 >= NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-1988
SELECT ALL col1 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL NOT BETWEEN + 36 AND - CAST( NULL AS SIGNED ) + - - 75
................................................................................
query I rowsort
SELECT ( col2 ) AS col2 FROM tab2 GROUP BY col2
----
58
79
87

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - AVG ( + + col1 ) * col1 col2, col1 AS col2 FROM tab1 GROUP BY col1
----
-1936
44
-3249
57
................................................................................
0
21

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort
SELECT ALL col2 + + col2 col0, col2 * col2 AS col2, 87 FROM tab2 GROUP BY col2
----
9 values hashing to 33cb52a23dd54bb82284e857c641ea18

query I rowsort
SELECT - 32 * - 19 FROM tab2 AS cor0 GROUP BY col1
................................................................................
----

skipif mysql # not compatible
query I rowsort label-2116
SELECT + CAST ( NULL AS INTEGER ) FROM tab1 GROUP BY col0 HAVING + CAST ( - col0 AS INTEGER ) IS NULL
----

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

query II rowsort
SELECT DISTINCT col0, - col1 AS col1 FROM tab2 GROUP BY col0, col1
----
................................................................................
query I rowsort
SELECT ALL - col2 + - 41 AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-112
-49
-86

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col1 col0, col1 FROM tab0 GROUP BY col1
----
0
0
81
81
................................................................................
-5278
0
-5336
2
-870

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-2221
SELECT DISTINCT 43 / - - ( - CAST ( - col0 AS INTEGER ) ) col2, - 59 * + col0 - - col0 FROM tab2 AS cor0 GROUP BY col0
----
0
-5278
0
-5336
................................................................................
SELECT - col1 * - + col1 FROM tab0 GROUP BY col1 HAVING NOT + - 36 * col1 IS NOT NULL
----

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL + 65 AS col0, col2 AS col2 FROM tab2 AS cor0 WHERE NOT NULL NOT IN ( col2, col2 * + + 24 + - ( col2 ), + 11 * + + col1 ) GROUP BY col1, col2 HAVING NULL NOT BETWEEN ( - col0 + 81 ) AND col0
----

query II rowsort
SELECT col2 AS col2, + 62 AS col0 FROM tab1 GROUP BY col2
----
................................................................................
----

skipif mysql # not compatible
query II rowsort label-2266
SELECT - - col2 AS col1, - col2 * + + 59 + - - CAST ( NULL AS INTEGER ) FROM tab0 WHERE + 29 + + col0 = - + ( - col0 ) GROUP BY col1, col2
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - AVG ( - col1 ) * 60 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NOT NULL <= ( - col2 )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2268
SELECT DISTINCT - CAST( + + 34 AS SIGNED ) col2 FROM tab1 AS cor0 GROUP BY col2
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2274
SELECT DISTINCT + col2 * 32 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL >= CAST( NULL AS SIGNED ) / col1 - 6
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-2274
SELECT DISTINCT + col2 * 32 AS col1 FROM tab1 GROUP BY col2 HAVING NOT NULL >= CAST ( NULL AS INTEGER ) / col1 - 6
----

query I rowsort
SELECT DISTINCT + col1 AS col0 FROM tab2 GROUP BY col1 HAVING NOT ( + 49 ) IS NULL
----
................................................................................
query I rowsort label-2459
SELECT ALL - col0 + - + col2 / + 29 FROM tab2 GROUP BY col2, col0, col0
----
-18
-93
-94

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col2 col2, col2 * - + ( - 8 ) FROM tab2 GROUP BY col1, col2
----
58
464
79
632
................................................................................
SELECT DISTINCT - col0 + - COALESCE ( + 92, - + 56 * + ( + col1 DIV 9 ) + 78 * - col2, - 67, - col0 + + 40 ) + + 32 DIV + col0 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-105
-183
-184

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-2532
SELECT DISTINCT - col0 + - COALESCE ( + 92, - + 56 * + ( + col1 / 9 ) + 78 * - col2, - 67, - col0 + + 40 ) + + 32 / + col0 FROM tab2 GROUP BY col0 HAVING ( NULL ) IS NULL
----
-105
-183
-184

................................................................................

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

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

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

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

query II rowsort
SELECT - 8 AS col1, + col0 FROM tab1 GROUP BY col1, col0, col0
----
................................................................................
query I rowsort label-2575
SELECT - AVG ( ALL + CAST ( NULL AS INTEGER ) ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT 22 col1, + 2 * ( col1 ) FROM tab0 AS cor0 WHERE 89 IS NULL GROUP BY col1
----

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

onlyif mysql # CAST syntax: DECIMAL type: 
query II rowsort label-2602
SELECT DISTINCT 34 * + + col2 * + AVG ( ALL - 64 ) + + col2 col1, CAST( NULL AS DECIMAL ) / - col0 / col0 FROM tab1 GROUP BY col0, col2 HAVING NOT ( - col2 >= NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-2602
SELECT DISTINCT 34 * + + col2 * + AVG ( ALL - 64 ) + + col2 col1, CAST ( NULL AS REAL ) / - col0 / col0 FROM tab1 GROUP BY col0, col2 HAVING NOT ( - col2 >= NULL )
----

query I rowsort
SELECT ALL col1 + + col0 FROM tab2 GROUP BY col0, col1 HAVING - 6 IS NOT NULL
----
................................................................................
-8

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - + 20 - + col2 col0, col2 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
-107
87
-78
58
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-2716
SELECT + col1 AS col0 FROM tab0 GROUP BY col1 HAVING + + 48 BETWEEN + + 73 AND col0 * + CAST( + 28 AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-2716
SELECT + col1 AS col0 FROM tab0 GROUP BY col1 HAVING + + 48 BETWEEN + + 73 AND col0 * + CAST ( + 28 AS INTEGER )
----

query I rowsort
SELECT 90 FROM tab0 GROUP BY col0
----
................................................................................
28
82

query I rowsort
SELECT DISTINCT col1 FROM tab0 GROUP BY col1 HAVING ( NULL ) IN ( - 60 )
----

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

query I rowsort
SELECT DISTINCT col0 FROM tab1 GROUP BY col0, col1 HAVING ( NULL ) IN ( - col0 )
----
................................................................................
query I rowsort
SELECT + ( - col0 ) AS col0 FROM tab2 AS cor0 GROUP BY col0
----
-15
-91
-92

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT - ( col0 ), col0 AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL NOT BETWEEN + col0 AND AVG ( DISTINCT + col1 ) + - col1
----

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

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col2 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING ( NULL ) >= + col2 + + col1 * + 71
----

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

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

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

query II rowsort
SELECT - + 24, + col2 FROM tab2 AS cor0 GROUP BY col1, col2
----
................................................................................
-8281
-8464

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

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

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT col1, - COALESCE ( 52, - col0 * - + col0 + - + col2 ) FROM tab2 AS cor0 GROUP BY col1 HAVING NOT - 91 / + 60 IS NULL
----
41
-52
59
-52
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3051
SELECT ALL + CAST( NULL AS SIGNED ) - 37, - 43 / - COALESCE ( - 92, - col0 * 85 + + col0 ) + - 19 - 10 * 97 FROM tab0 GROUP BY col1, col2, col1 HAVING NOT 21 = NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-3051
SELECT ALL + CAST ( NULL AS INTEGER ) - 37, - 43 / - COALESCE ( - 92, - col0 * 85 + + col0 ) + - 19 - 10 * 97 FROM tab0 GROUP BY col1, col2, col1 HAVING NOT 21 = NULL
----

query I rowsort
SELECT DISTINCT ( + col0 ) * + + 19 AS col2 FROM tab1 GROUP BY col0
----
................................................................................
58
58
79
79
87
87

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + - col1 AS col0 FROM tab1 cor0 GROUP BY col1, col1 HAVING NULL < col0 + ( + 38 )
----

query II rowsort
SELECT DISTINCT - 12 AS col1, 4 / col0 AS col0 FROM tab2 cor0 GROUP BY col0 HAVING NOT NULL IS NULL
----
................................................................................
1166
22
1484
28
4346
82

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT DISTINCT 34 + + 62 * - + col1 col0 FROM tab2 GROUP BY col1
................................................................................
query I rowsort
SELECT DISTINCT - col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING - col0 IS NOT NULL
----
-15
-91
-92

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col0 * - 92 + AVG ( + col0 ) AS col2 FROM tab0 GROUP BY col0 HAVING ( NULL ) <= col2
----

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

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3242
SELECT DISTINCT - - col1 / + col1 - COALESCE ( 56, col0 * + 88 + CAST( NULL AS SIGNED ) * + - col0 + + col1 * - col2 ) * col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col0 <= ( NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3242
SELECT DISTINCT - - col1 / + col1 - COALESCE ( 56, col0 * + 88 + CAST ( NULL AS INTEGER ) * + - col0 + + col1 * - col2 ) * col1 AS col0 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT + col0 <= ( NULL )
----

query I rowsort
SELECT 72 FROM tab2 GROUP BY col2, col1 HAVING col1 IN ( + - col2 + - + col2 )
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3251
SELECT CAST( NULL AS SIGNED ) + 73 * col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3251
SELECT CAST ( NULL AS INTEGER ) + 73 * col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT col2 NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT 42 + + col0 AS col0 FROM tab2 GROUP BY col0
----
................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3355
SELECT DISTINCT - + CASE col2 WHEN - CAST( NULL AS SIGNED ) THEN + - col1 END * - ( - col1 ) - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + - col1 IS NULL
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3355
SELECT DISTINCT - + CASE col2 WHEN - CAST ( NULL AS INTEGER ) THEN + - col1 END * - ( - col1 ) - - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + - col1 IS NULL
----
NULL

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

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-3375
SELECT ALL + COALESCE ( + + 36, - 17 * - - col1 + + col2, col0 ) AS col1 FROM tab2 GROUP BY col2, col0 HAVING NULL NOT BETWEEN - CAST( 60 AS SIGNED ) / - CAST( - col1 AS SIGNED ) AND + 12
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3375
SELECT ALL + COALESCE ( + + 36, - 17 * - - col1 + + col2, col0 ) AS col1 FROM tab2 GROUP BY col2, col0 HAVING NULL NOT BETWEEN - CAST ( 60 AS INTEGER ) / - CAST ( - col1 AS INTEGER ) AND + 12
----

onlyif mysql # CAST syntax: SIGNED type: 
query III rowsort label-3376
SELECT ALL + col2 + + 38, - col2, + 67 col2 FROM tab0 WHERE NOT ( - + 61 ) <> - CAST( + CAST( NULL AS SIGNED ) AS SIGNED ) GROUP BY col2 HAVING ( + col2 ) = - 86
................................................................................
-79
-79

query I rowsort
SELECT DISTINCT - col1 FROM tab1 AS cor0 WHERE - col0 BETWEEN NULL AND col1 GROUP BY col1, col0
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + CASE - 56 WHEN + 63 THEN col2 * + 96 * col1 / + - 84 / + - col2 + + col1 ELSE NULL END AS col1 FROM tab2 AS cor0 GROUP BY col1, col0
----
NULL
NULL
NULL

................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3523
SELECT - col2 col1, - col0 FROM tab1 WHERE + CAST( + col0 AS SIGNED ) + - NULLIF ( 91, + - 5 + 87 ) IS NOT NULL GROUP BY col0, col2, col1 HAVING NOT col2 / + 87 + + col1 IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-3523
SELECT - col2 col1, - col0 FROM tab1 WHERE + CAST ( + col0 AS INTEGER ) + - NULLIF ( 91, + - 5 + 87 ) IS NOT NULL GROUP BY col0, col2, col1 HAVING NOT col2 / + 87 + + col1 IS NOT NULL
----

query II rowsort
SELECT + col2 AS col2, - col2 AS col0 FROM tab0 GROUP BY col2, col2
----
................................................................................
query I rowsort
SELECT ALL + 64 AS col1 FROM tab2 AS cor0 GROUP BY col2
----
64
64
64

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col2 * - + COALESCE ( + 81, + col2, - + col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL NOT IN ( + + ( - 67 ) )
----

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-3568
SELECT DISTINCT col2, + col2 AS col1 FROM tab1 AS cor0 WHERE + col2 * - - col2 <= - CAST( col1 AS SIGNED ) GROUP BY col2, col1 HAVING NOT + col1 IS NULL
................................................................................
query I rowsort
SELECT + col0 AS col0 FROM tab0 GROUP BY col0, col2, col1
----
26
43
83

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT + - col1 col1, + col1 FROM tab1 AS cor0 WHERE NOT ( NULL ) = - col0 GROUP BY col1
----

query I rowsort
SELECT col1 - - 79 + col1 FROM tab1 AS cor0 GROUP BY col1
----
................................................................................
query I rowsort label-3747
SELECT - col1 * + COALESCE ( + - 80, + + col0, col2 + col0 DIV col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6480

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3747
SELECT - col1 * + COALESCE ( + - 80, + + col0, col2 + col0 / col0 ) AS col2 FROM tab0 AS cor0 GROUP BY col1
----
0
6480

query I rowsort
................................................................................
----

skipif mysql # not compatible
query I rowsort label-3778
SELECT - col1 FROM tab1 AS cor0 GROUP BY col1 HAVING - col1 / - 94 * + CAST ( NULL AS INTEGER ) IS NOT NULL
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT DISTINCT col2 - + col2 AS col1, ( + col2 ) * - col2 * + + 40 * + 9 AS col0 FROM tab2 GROUP BY col2 HAVING NOT NULL BETWEEN ( col2 * + col0 ) AND NULL
----

query I rowsort
SELECT - col2 + - - ( + col2 ) + + + col2 FROM tab0 GROUP BY col2
----
................................................................................
onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-3949
SELECT DISTINCT - NULLIF ( + ( CAST( NULL AS DECIMAL ) ), - col1 ) * + col0 AS col2 FROM tab1 WHERE NOT - 41 + 34 * col0 = + - col0 GROUP BY col0
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3949
SELECT DISTINCT - NULLIF ( + ( CAST ( NULL AS REAL ) ), - col1 ) * + col0 AS col2 FROM tab1 WHERE NOT - 41 + 34 * col0 = + - col0 GROUP BY col0
----
NULL

query I rowsort
SELECT - col2 * + col2 FROM tab1 WHERE - ( - ( - col0 ) ) NOT IN ( - col0 ) GROUP BY col2, col2
................................................................................
SELECT - + col1 DIV + col1 + col1 + - 98 + + - col1 DIV + COALESCE ( 39, - 78 * + col0 * ( + col2 ) - + 27, + 50 ) AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-39
-41
-59

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4012
SELECT - + col1 / + col1 + col1 + - 98 + + - col1 / + COALESCE ( 39, - 78 * + col0 * ( + col2 ) - + 27, + 50 ) AS col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NULL IS NULL
----
-39
-41
-59

................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-4036
SELECT col0 + 74 AS col1, col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL <> CAST( + + col2 AS SIGNED ) + - NULLIF ( - + col2, - - col1 + - col2 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-4036
SELECT col0 + 74 AS col1, col0 AS col2 FROM tab0 GROUP BY col0 HAVING NOT NULL <> CAST ( + + col2 AS INTEGER ) + - NULLIF ( - + col2, - - col1 + - col2 )
----

query I rowsort
SELECT ALL + col1 + - - col1 + + + col2 - + 23 AS col1 FROM tab1 AS cor0 GROUP BY col2, col0, col1
----
................................................................................
SELECT + col1 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NULL > - ( 44 ) * - ( + CAST ( + 38 AS REAL ) ) * + + 40
----

query I rowsort
SELECT DISTINCT 62 AS col0 FROM tab2 GROUP BY col1, col1 HAVING NOT ( - COALESCE ( + - 19, ( - 66 ) + + 13 ) ) <= ( NULL )
----

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

query I rowsort
SELECT DISTINCT - 65 AS col0 FROM tab2 AS cor0 WHERE NOT - col1 IS NOT NULL GROUP BY col0, col1 HAVING NULL IS NULL
----
................................................................................
query I rowsort
SELECT ALL + col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col2 HAVING + 87 IS NOT NULL
----
45
71
8

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( 65, col2 * - col2 / - col2 + + col2 + - 26 + col0, + - col1 ) AS col0 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT NULL <= + - col0
----

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

query I rowsort
SELECT ALL col1 * ( + - col0 ) FROM tab0 GROUP BY col1, col0 HAVING + 52 + - col0 * + 98 IS NULL
----

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT ALL col2 col1 FROM tab2 WHERE ( NULL ) <> ( NULL ) GROUP BY col0, col2, col0 HAVING - col2 >= 17 * - ( AVG ( - ( col1 ) ) )
................................................................................
query I rowsort
SELECT + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING 75 IS NOT NULL
----
24
38
79

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

query I rowsort
SELECT ALL - 12 * col0 AS col0 FROM tab2 GROUP BY col1, col0
----
................................................................................
query I rowsort
SELECT ALL 96 AS col0 FROM tab1 cor0 GROUP BY col1, col0
----
96
96
96

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col0 col1, - col0 FROM tab1 AS cor0 WHERE NOT ( NULL ) IS NOT NULL GROUP BY col0
----
22
-22
28
-28
................................................................................
query I rowsort label-4485
SELECT DISTINCT col2 + - + 69 / + col2 AS col0 FROM tab1 AS cor0 GROUP BY col2
----
0
44
71

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col1 + + col1 + - col1 * - col1 + - col2 - - col1 AS col0 FROM tab2 AS cor0 WHERE - col2 + - 42 IS NULL GROUP BY col1, col2, col1 HAVING ( NULL ) NOT BETWEEN col0 AND - col0 / - - col0 * col0 + col2
----

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

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

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-4511
SELECT - - col0 / 19 * 7 + - col0 * + CAST ( - col0 AS REAL ) - + + CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) col1 FROM tab0 cor0 GROUP BY col0 HAVING NULL NOT BETWEEN ( - ( - col1 ) ) AND NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + col1 col0, - col1 * col1 AS col0 FROM tab1 GROUP BY col1
----
44
-1936
57
-3249
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4530
SELECT - ( - + CAST( + 34 AS SIGNED ) ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL NOT BETWEEN + col1 AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4530
SELECT - ( - + CAST ( + 34 AS INTEGER ) ) AS col1 FROM tab2 AS cor0 GROUP BY col2, col0 HAVING NOT NULL NOT BETWEEN + col1 AND NULL
----

query I rowsort
SELECT - col1 * + - col1 * + col1 FROM tab1 AS cor0 GROUP BY col1, col1
----
................................................................................
-58
58
-79
79
-87
87

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL col1 * col0 AS col2 FROM tab0 cor0 GROUP BY col0, col1 HAVING NOT NULL NOT IN ( + - NULLIF ( + - NULLIF ( col2, 11 - - ( - 78 ) + + col2 * col1 * + col0 ), - NULLIF ( + col0, - col0 ) + + col0 * - - col1 + col1 ) )
----

query I rowsort
SELECT + col2 AS col1 FROM tab2 WHERE + col0 IS NOT NULL GROUP BY col2
----
................................................................................
query I rowsort
SELECT 10 * col2 + - col2 AS col2 FROM tab0 AS cor0 GROUP BY col2
----
216
342
711

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

onlyif mysql # aggregate syntax: 
query II rowsort label-4682
SELECT - ( + - 6 ) + - col2 * + SUM( ALL - 46 ) / - - ( 48 ), CASE WHEN NOT col2 IS NULL THEN NULL WHEN 71 IS NULL THEN - ( col1 ) * - col0 * + - 64 / - AVG ( 57 ) END FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( + COUNT( * ) > NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-4682
SELECT - ( + - 6 ) + - col2 * + SUM ( ALL - 46 ) / - - ( 48 ), CASE WHEN NOT col2 IS NULL THEN NULL WHEN 71 IS NULL THEN - ( col1 ) * - col0 * + - 64 / - AVG ( 57 ) END FROM tab2 AS cor0 GROUP BY col1, col2 HAVING ( + COUNT ( * ) > NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-4683
SELECT ALL CAST( NULL AS SIGNED ) + + 63 FROM tab1 AS cor0 GROUP BY col0
................................................................................
query I rowsort
SELECT - col2 * + 52 AS col0 FROM tab1 GROUP BY col2 HAVING NOT NULL IS NOT NULL
----
-2340
-3692
-416

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + - 30, - col0 - + 41, 26 * - col0 - - 14 * - 43 ) + + col1 AS col0 FROM tab2 GROUP BY col1
----
11
29
31

................................................................................
SELECT ALL - CASE - CAST( NULL AS SIGNED ) WHEN + + 47 THEN + col0 + col1 END * COALESCE ( - 7, 76 * 59, + 47 ) FROM tab1 GROUP BY col2, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4811
SELECT ALL - CASE - CAST ( NULL AS INTEGER ) WHEN + + 47 THEN + col0 + col1 END * COALESCE ( - 7, 76 * 59, + 47 ) FROM tab1 GROUP BY col2, col0
----
NULL
NULL
NULL

................................................................................
-1
12
-1
2
-1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-4826
SELECT + - 99 / - col2 col0, - ( - col2 ) / - col2 + col2 - + col2 FROM tab1 AS cor0 GROUP BY col2, col2
----
1
-1
12
-1
................................................................................
query I rowsort
SELECT + ( + 55 ) + col0 * - - col0 + 0 FROM tab0 AS cor0 GROUP BY col0
----
1904
6944
731

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT col1 * col1 * + 1 + col1 col1, 72 + - col1 FROM tab1 GROUP BY col1
----
1980
28
3306
15
................................................................................

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

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

query I rowsort
SELECT ( + 21 ) AS col1 FROM tab2 GROUP BY col0 HAVING NOT NULL >= NULL
----
................................................................................
SELECT ALL - - COALESCE ( - 85, col2 * - + CAST( + 49 AS SIGNED ), + col1 ) FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-85
-85
-85

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-4923
SELECT ALL - - COALESCE ( - 85, col2 * - + CAST ( + 49 AS INTEGER ), + col1 ) FROM tab2 WHERE NOT NULL IS NOT NULL GROUP BY col0
----
-85
-85
-85

................................................................................
----

skipif mysql # not compatible
query I rowsort label-4972
SELECT MIN ( - col2 ) + 20 * + 10 AS col1 FROM tab1 GROUP BY col0, col2 HAVING NOT + COUNT ( * ) / + 88 - col0 * 11 NOT BETWEEN NULL AND col0
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - col0 * 1 AS col1 FROM tab2 GROUP BY col0, col2 HAVING NULL NOT BETWEEN col1 * 72 + ( 33 ) AND 17 * col0
----

onlyif mysql # aggregate syntax: 
query I rowsort label-4974
SELECT + ( + COUNT( * ) ) FROM tab0 GROUP BY col2, col2
................................................................................
SELECT - CASE + - CAST( NULL AS SIGNED ) WHEN - col0 * - + 67 + + 17 THEN NULL WHEN CAST( NULL AS SIGNED ) THEN - CAST( 37 AS SIGNED ) * - - col1 - + COUNT( * ) + + + COUNT( * ) END + - + ( CAST( + 88 AS DECIMAL ) ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5014
SELECT - CASE + - CAST ( NULL AS INTEGER ) WHEN - col0 * - + 67 + + 17 THEN NULL WHEN CAST ( NULL AS INTEGER ) THEN - CAST ( 37 AS INTEGER ) * - - col1 - + COUNT ( * ) + + + COUNT ( * ) END + - + ( CAST ( + 88 AS REAL ) ) FROM tab0 GROUP BY col0
----
NULL
NULL
NULL

................................................................................
query II rowsort label-5017
SELECT DISTINCT + COUNT( * ) col0, + COALESCE ( - 50, - col1, + COUNT( ALL 34 ) * - col0 ) FROM tab2 GROUP BY col1, col1, col1
----
1
-50

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5017
SELECT DISTINCT + COUNT ( * ) col0, + COALESCE ( - 50, - col1, + COUNT ( ALL 34 ) * - col0 ) FROM tab2 GROUP BY col1, col1, col1
----
1
-50

query I rowsort
................................................................................
query I rowsort
SELECT DISTINCT + col1 * ( col2 ) FROM tab1 GROUP BY col2, col1
----
2565
3124
48

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + col0, 19, - col2 - col2, + col1 ) * col0 FROM tab0 GROUP BY col0
----
1849
676
6889

................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5046
SELECT DISTINCT CASE - 75 WHEN CAST( NULL AS SIGNED ) THEN col1 END * - col0 FROM tab0 GROUP BY col0, col2 HAVING NOT + AVG ( 29 ) IN ( - col2 )
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5046
SELECT DISTINCT CASE - 75 WHEN CAST ( NULL AS INTEGER ) THEN col1 END * - col0 FROM tab0 GROUP BY col0, col2 HAVING NOT + AVG ( 29 ) IN ( - col2 )
----
NULL

onlyif mysql # aggregate syntax: 
query I rowsort label-5047
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-5120
SELECT DISTINCT + col2 * + MIN( 66 ) * + 40 AS col0 FROM tab1 GROUP BY col2, col1, col2 HAVING ( NULL ) BETWEEN + 67 * col0 AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5120
SELECT DISTINCT + col2 * + MIN ( 66 ) * + 40 AS col0 FROM tab1 GROUP BY col2, col1, col2 HAVING ( NULL ) BETWEEN + 67 * col0 AND NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5121
SELECT DISTINCT + col0 FROM tab2 cor0 GROUP BY col0, col2 HAVING NOT ( - CAST( NULL AS SIGNED ) ) <= ( CAST( NULL AS SIGNED ) )
................................................................................
----

skipif mysql # not compatible
query I rowsort label-5138
SELECT DISTINCT CAST ( NULL AS INTEGER ) FROM tab2 AS cor0 WHERE NOT NULL IN ( col1 ) GROUP BY col1
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL 40 - - col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT ( - + col1 * + col0 ) <= ( NULL )
----

query I rowsort
SELECT DISTINCT col0 * + + col0 AS col1 FROM tab1 GROUP BY col0 HAVING NOT - + 26 IS NOT NULL
----
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-5151
SELECT 37 * + COUNT( * ) AS col0 FROM tab0 GROUP BY col1, col2 HAVING NULL BETWEEN ( NULLIF ( col1, col1 / col0 + col1 + - col1 ) * + COUNT( * ) ) AND ( NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5151
SELECT 37 * + COUNT ( * ) AS col0 FROM tab0 GROUP BY col1, col2 HAVING NULL BETWEEN ( NULLIF ( col1, col1 / col0 + col1 + - col1 ) * + COUNT ( * ) ) AND ( NULL )
----

query I rowsort
SELECT ALL + + col0 + + + 86 * + col1 AS col2 FROM tab2 AS cor0 GROUP BY col1, col0 HAVING NULL IN ( 73 )
----
................................................................................
0
2
0
3
81

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5241
SELECT DISTINCT - - 81 / - - col2 col1, col1 AS col2 FROM tab0 AS cor0 GROUP BY col2, col1 HAVING ( + col2 / + 58 ) <> 48
----
1
0
2
0
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5300
SELECT ALL col1 * - col1 + col1 + col1 + - 7 * - CASE + 93 WHEN 33 THEN - col0 / COUNT( * ) * - col1 + + 1 WHEN - CAST( NULL AS SIGNED ) + + 86 THEN + AVG ( - - col0 ) END * 47 FROM tab2 AS cor0 WHERE NOT NULL > - 75 GROUP BY col1, col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5300
SELECT ALL col1 * - col1 + col1 + col1 + - 7 * - CASE + 93 WHEN 33 THEN - col0 / COUNT ( * ) * - col1 + + 1 WHEN - CAST ( NULL AS INTEGER ) + + 86 THEN + AVG ( - - col0 ) END * 47 FROM tab2 AS cor0 WHERE NOT NULL > - 75 GROUP BY col1, col1
----

query II rowsort
SELECT ALL + col1, - col1 AS col2 FROM tab0 AS cor0 GROUP BY col1
----
................................................................................

onlyif mysql # aggregate syntax: 
query II rowsort label-5327
SELECT ALL - 89 AS col0, MAX( ALL - col0 ) AS col2 FROM tab2 GROUP BY col0 HAVING NULL = col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-5327
SELECT ALL - 89 AS col0, MAX ( ALL - col0 ) AS col2 FROM tab2 GROUP BY col0 HAVING NULL = col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5328
SELECT DISTINCT - 48 + - col1 * + 71 + + - 11 * - 27 FROM tab0 GROUP BY col1 HAVING NOT NULL BETWEEN - col1 AND + col1 * CAST( 13 AS SIGNED ) + + 72 + 65 * - 24
................................................................................

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-5330
SELECT + CAST( NULL AS DECIMAL ) + - 66 / + col2 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL >= col0
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5330
SELECT + CAST ( NULL AS REAL ) + - 66 / + col2 AS col0 FROM tab1 GROUP BY col1, col2 HAVING NOT NULL >= col0
----

query I rowsort
SELECT DISTINCT - 11 FROM tab1 GROUP BY col2, col1
----
................................................................................
NULL
29
NULL
29
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5392
SELECT ALL + 29 col0, 33 * - MIN ( CAST ( + CASE col1 WHEN + 26 THEN + col1 END AS INTEGER ) ) - col2 * - NULLIF ( 6, col0 ) FROM tab2 GROUP BY col2, col0, col2
----
29
NULL
29
NULL
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-5394
SELECT col1 AS col2 FROM tab2 WHERE - - 60 - + col1 BETWEEN + col2 / col1 AND + col0 * + ( CAST( NULL AS SIGNED ) ) GROUP BY col1 HAVING NOT NULL < + col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5394
SELECT col1 AS col2 FROM tab2 WHERE - - 60 - + col1 BETWEEN + col2 / col1 AND + col0 * + ( CAST ( NULL AS INTEGER ) ) GROUP BY col1 HAVING NOT NULL < + col2
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-5395
SELECT ALL + - COALESCE ( + col1, + - col0 DIV COUNT( * ) * - + col1 * 21 + MIN( + 23 ), - col0 * 53 + - ( col1 ) * - col0 ) FROM tab0 AS cor0 GROUP BY col0, col1
................................................................................
skipif mysql # not compatible
query I rowsort label-5463
SELECT ALL + + COUNT ( * ) * 8 FROM tab0 AS cor0 GROUP BY col1
----
16
8

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ( - AVG ( ALL col2 ) ) + ( + col2 ) col0, + col2 * + + col2 FROM tab0 AS cor0 GROUP BY col2 HAVING NULL IN ( - col0 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5465
SELECT DISTINCT + COUNT( * ) AS col0 FROM tab0 GROUP BY col2 HAVING NOT - - ( 69 ) < col2
................................................................................
-58
-1851360
-58
-5421840
-58

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-5557
SELECT MIN ( DISTINCT + 29 ) * + COUNT ( * ) * - - 95 * - ( - col0 ) * + ( - 24 ), - COALESCE ( ( + + 58 ), + - col0 + col2 * + 40 + - 27, + 25 ) AS col1 FROM tab1 GROUP BY col0
----
-1454640
-58
-1851360
-58
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-5581
SELECT ALL + COALESCE ( + + MIN( DISTINCT 49 ), + - COUNT( * ), + COUNT( * ) * + 97 ) * 8 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL >= + col2 / + - 43 * - ( - col2 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5581
SELECT ALL + COALESCE ( + + MIN ( DISTINCT 49 ), + - COUNT ( * ), + COUNT ( * ) * + 97 ) * 8 AS col2 FROM tab2 AS cor0 GROUP BY col0, col1 HAVING NULL >= + col2 / + - 43 * - ( - col2 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5582
SELECT - SUM( + col2 ) * COUNT( * ) - + - 56 + - col2 FROM tab0 WHERE NOT + col2 <> ( - col2 ) GROUP BY col2, col0
................................................................................

onlyif mysql # aggregate syntax: 
query III rowsort label-5677
SELECT 65 - 20 * + MAX( ALL - col0 ) - + - col0 * + col0, + col0 col0, - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL < - 6 / + + COUNT( col0 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort label-5677
SELECT 65 - 20 * + MAX ( ALL - col0 ) - + - col0 * + col0, + col0 col0, - - col0 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT NULL < - 6 / + + COUNT ( col0 )
----

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

onlyif mysql # aggregate syntax: 
query II rowsort label-5679
SELECT DISTINCT - col2, + COUNT( * ) + + + col2 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT - col0 <> NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-5679
SELECT DISTINCT - col2, + COUNT ( * ) + + + col2 AS col0 FROM tab1 cor0 GROUP BY col2 HAVING NOT - col0 <> NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col2, col2 + + col2 col2 FROM tab0 AS cor0 GROUP BY col2
................................................................................
-15
-65
-91
-65
-92

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-5720
SELECT - 65 col2, COUNT ( * ) * - ( + col0 ) FROM tab2 GROUP BY col0, col0 HAVING NOT ( NOT ( MIN ( - + col2 ) IS NOT NULL ) )
----
-65
-15
-65
-91
................................................................................
query I rowsort label-5752
SELECT ALL - MIN ( ALL + - col0 ) / col0 AS col1 FROM tab1 AS cor0 GROUP BY col0 HAVING NOT + col0 IS NULL
----
1
1
1

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( col0, - 17 + 18, - ( + - 1 ) + ( + + col1 ) - - + 65 ) FROM tab1 cor0 GROUP BY col0
----
22
28
82

................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5757
SELECT col2 * - + CAST( NULL AS SIGNED ) + + col2 AS col1 FROM tab1 WHERE NOT ( NOT NULL < + col0 + + col0 ) GROUP BY col2 HAVING NOT NULL = + 70 + - + col1 AND 60 - + COUNT( * ) + col2 + - col1 <> NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5757
SELECT col2 * - + CAST ( NULL AS INTEGER ) + + col2 AS col1 FROM tab1 WHERE NOT ( NOT NULL < + col0 + + col0 ) GROUP BY col2 HAVING NOT NULL = + 70 + - + col1 AND 60 - + COUNT ( * ) + col2 + - col1 <> NULL
----

query I rowsort
SELECT DISTINCT - col0 AS col1 FROM tab2 GROUP BY col0 HAVING NULL = NULL
----
................................................................................
----

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL + col1 col0, col1 FROM tab1 GROUP BY col1 HAVING + 20 < - 77
----

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

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + - col0 col0, col0 + + - 40 FROM tab1 AS cor0 WHERE ( NULL ) IS NOT NULL GROUP BY col0, col2
----

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

skipif mysql # not compatible
query I rowsort label-5829
SELECT DISTINCT + 13 + - CAST ( - col2 AS INTEGER ) + + col2 * - 21 FROM tab1 AS cor0 WHERE NOT ( NULL ) NOT BETWEEN NULL AND - col2 GROUP BY col2, col1
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - 98 + col2 + + COALESCE ( - - ( - 21 ), + - ( col0 ) ) * ( - col2 ) * + col2 + - col2 FROM tab1 AS cor0 GROUP BY col2
----
105763
1246
42427

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

onlyif mysql # aggregate syntax: 
query I rowsort label-5832
SELECT + - col0 * - MAX( - col0 ) * + + col0 * + + col0 + - col0 FROM tab1 AS cor0 GROUP BY col0
................................................................................
SELECT CASE + 58 WHEN + 5 THEN col0 END col0 FROM tab0 GROUP BY col0, col0, col2 HAVING ( + 30 ) NOT BETWEEN NULL AND - COUNT( * ) + - col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort label-5853
SELECT CASE + 58 WHEN + 5 THEN col0 END col0 FROM tab0 GROUP BY col0, col0, col2 HAVING ( + 30 ) NOT BETWEEN NULL AND - COUNT ( * ) + - col2
----
NULL
NULL
NULL

................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5884
SELECT - - ( + 90 ) AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <= - + 21 * ( + 30 / 82 + MIN( DISTINCT CAST( NULL AS SIGNED ) ) ) + ( col1 - COUNT( * ) / 80 ) * + 28
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5884
SELECT - - ( + 90 ) AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING NOT NULL <= - + 21 * ( + 30 / 82 + MIN ( DISTINCT CAST ( NULL AS INTEGER ) ) ) + ( col1 - COUNT ( * ) / 80 ) * + 28
----

query I rowsort
SELECT ALL + col1 + + col1 AS col2 FROM tab1 cor0 GROUP BY col1
----
................................................................................
query I rowsort label-5924
SELECT DISTINCT col1 * - CASE WHEN NULL NOT IN ( 52, - col0, + col0 + ( + + COUNT( * ) ), - CAST( NULL AS SIGNED ) ) THEN + - NULLIF ( - 84, + - SUM( + col2 ) - 35 ) ELSE COUNT( * ) END FROM tab0 GROUP BY col1
----
-81
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5924
SELECT DISTINCT col1 * - CASE WHEN NULL NOT IN ( 52, - col0, + col0 + ( + + COUNT ( * ) ), - CAST ( NULL AS INTEGER ) ) THEN + - NULLIF ( - 84, + - SUM ( + col2 ) - 35 ) ELSE COUNT ( * ) END FROM tab0 GROUP BY col1
----
-81
0

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5932
SELECT ALL col2 + col2 - - 43 * + - COUNT( * ) / CASE + CAST( NULL AS SIGNED ) WHEN - - COALESCE ( - + 59, col1 / col1 * + COUNT( ALL + - 40 ) * - 52, - - CASE WHEN col1 NOT BETWEEN NULL AND NULL THEN NULL ELSE 33 + + col0 / 65 END * col2 ) * - col2 + col0 THEN - COUNT( * ) WHEN col0 THEN NULL END FROM tab2 GROUP BY col0, col2 HAVING ( col0 ) BETWEEN ( CAST( NULL AS SIGNED ) ) AND NULLIF ( - CAST( NULL AS SIGNED ), 92 + + ( - AVG ( DISTINCT col2 ) ) / 76 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5932
SELECT ALL col2 + col2 - - 43 * + - COUNT ( * ) / CASE + CAST ( NULL AS INTEGER ) WHEN - - COALESCE ( - + 59, col1 / col1 * + COUNT ( ALL + - 40 ) * - 52, - - CASE WHEN col1 NOT BETWEEN NULL AND NULL THEN NULL ELSE 33 + + col0 / 65 END * col2 ) * - col2 + col0 THEN - COUNT ( * ) WHEN col0 THEN NULL END FROM tab2 GROUP BY col0, col2 HAVING ( col0 ) BETWEEN ( CAST ( NULL AS INTEGER ) ) AND NULLIF ( - CAST ( NULL AS INTEGER ), 92 + + ( - AVG ( DISTINCT col2 ) ) / 76 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-5933
SELECT MAX( - ( - col1 ) ) FROM tab2 cor0 GROUP BY col1, col1
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-5990
SELECT DISTINCT - ( - COALESCE ( 45, + col2, + col1, CAST( + COUNT( * ) AS SIGNED ) ) ) FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5990
SELECT DISTINCT - ( - COALESCE ( 45, + col2, + col1, CAST ( + COUNT ( * ) AS INTEGER ) ) ) FROM tab1 WHERE NULL IS NOT NULL GROUP BY col1
----

query I rowsort
SELECT DISTINCT 40 FROM tab0 GROUP BY col2, col1
----
................................................................................
query I rowsort label-6112
SELECT + ( + 59 ) + ( + NULLIF ( 79, + ( + COUNT ( * ) ) ) ) FROM tab2 GROUP BY col0, col1, col1
----
138
138
138

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + + 74 col2 FROM tab2 AS cor0 GROUP BY col2, col1 HAVING NOT ( + col1 ) < ( 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 II rowsort
SELECT + + col2 col2, 27 FROM tab0 cor0 GROUP BY col2
----
24
27
38
27
................................................................................
SELECT + - NULLIF ( - CAST( NULL AS SIGNED ), + CAST( 46 AS SIGNED ) + - CAST( + col0 AS DECIMAL ) ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6154
SELECT + - NULLIF ( - CAST ( NULL AS INTEGER ), + CAST ( 46 AS INTEGER ) + - CAST ( + col0 AS REAL ) ) FROM tab2 AS cor0 GROUP BY col2
----
NULL
NULL
NULL

................................................................................
-24
144
-38
228
-79
474

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

onlyif mysql # aggregate syntax: 
query II rowsort label-6161
SELECT ALL 92, COUNT( * ) FROM tab0 GROUP BY col0 HAVING + 14 IS NULL
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-6165
SELECT DISTINCT + col0 * - col0 + MIN( + 27 ) AS col2 FROM tab0 AS cor0 WHERE - col0 IS NULL GROUP BY col0 HAVING NOT - col2 <= NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6165
SELECT DISTINCT + col0 * - col0 + MIN ( + 27 ) AS col2 FROM tab0 AS cor0 WHERE - col0 IS NULL GROUP BY col0 HAVING NOT - col2 <= NULL
----

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

onlyif mysql # aggregate syntax: 
query I rowsort label-6176
SELECT ALL + - COUNT( * ) * + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING - 19 + col2 > NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6176
SELECT ALL + - COUNT ( * ) * + col1 AS col2 FROM tab1 AS cor0 GROUP BY col1 HAVING - 19 + col2 > NULL
----

query I rowsort
SELECT 40 AS col1 FROM tab0 AS cor0 WHERE NOT + 91 + - 78 - + col1 IS NULL GROUP BY col2
----
................................................................................
49

query I rowsort
SELECT ALL + col0 * 4 FROM tab1 WHERE NOT col0 BETWEEN + 24 AND + + col0 GROUP BY col0, col2
----
88

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

query I rowsort
SELECT col0 AS col2 FROM tab2 WHERE NULL > - + col0 - 41 + + 14 GROUP BY col1, col0 HAVING NOT + + col0 IS NOT NULL
----
................................................................................

onlyif mysql # aggregate syntax: 
query II rowsort label-6199
SELECT ALL + + col2 * col0 - - 89 col1, - 93 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING col0 + - + 4 BETWEEN COUNT( * ) * - + 88 * + + ( col0 ) AND ( NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6199
SELECT ALL + + col2 * col0 - - 89 col1, - 93 AS col1 FROM tab2 AS cor0 GROUP BY col0, col2 HAVING col0 + - + 4 BETWEEN COUNT ( * ) * - + 88 * + + ( col0 ) AND ( NULL )
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-6200
SELECT CAST( NULL AS SIGNED ) AS col1 FROM tab0 GROUP BY col2 HAVING NOT NULL IS NULL
................................................................................
query I rowsort label-6231
SELECT col1 - - ( col1 ) / col1 col0 FROM tab1 AS cor0 GROUP BY col1
----
45
58
7

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + ( 33 ) col0, + col1 FROM tab0 GROUP BY col1 HAVING col1 <> NULL
----

query I rowsort
SELECT ALL + col1 * - - col1 FROM tab0 GROUP BY col1
----
................................................................................
1
-71
1
-8
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6247
SELECT + - MIN ( + col2 ) col0, COUNT ( * ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-45
1
-71
1
................................................................................
query I rowsort
SELECT ( + col2 ) * col2 * 30 - + col2 * - 4 + - col2 FROM tab0 GROUP BY col2
----
17352
187467
43434

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( 67, ( + - col0 ) ) FROM tab0 AS cor0 GROUP BY col2
----
-67

query I rowsort
SELECT ALL + col2 * + col2 + + col2 * + 19 AS col2 FROM tab2 AS cor0 GROUP BY col2, col2
................................................................................
----
1
50
2
50

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6325
SELECT COUNT ( * ) col2, + 50 AS col2 FROM tab0 cor0 GROUP BY col1, col1
----
1
50
2
50
................................................................................
query I rowsort label-6327
SELECT + + COUNT ( * ) * + 88 + + + col1 + - COUNT ( * ) * + col1 + + col1 FROM tab2 AS cor0 GROUP BY col1 HAVING NOT 80 * + - col1 IS NULL
----
129
147
149

skipif postgresql # PostgreSQL requires AS when renaming output columns
query III rowsort
SELECT 93 col2, 28 + col1 * - 85 AS col0, col1 FROM tab2 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6329
SELECT DISTINCT + COUNT( * ) * - + col0 FROM tab2 GROUP BY col0, col0 HAVING NULL BETWEEN NULL AND COUNT( * ) * - COUNT( * )
................................................................................

onlyif mysql # aggregate syntax: 
query II rowsort label-6341
SELECT - 37 - + col2 * + col2 AS col0, 65 AS col1 FROM tab0 GROUP BY col2 HAVING NULL NOT BETWEEN col1 + + COUNT( * ) AND - 7
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-6341
SELECT - 37 - + col2 * + col2 AS col0, 65 AS col1 FROM tab0 GROUP BY col2 HAVING NULL NOT BETWEEN col1 + + COUNT ( * ) AND - 7
----

query II rowsort
SELECT ALL + col2 AS col0, col2 AS col0 FROM tab1 GROUP BY col2
----
................................................................................
query I rowsort label-6353
SELECT COUNT ( + ( - col0 ) ) / 53 col1 FROM tab0 GROUP BY col0
----
0
0
0

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

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DIV for integer division: 
query I rowsort label-6355
SELECT + MAX( ALL + NULLIF ( + COALESCE ( - CAST( col1 AS SIGNED ), 0 ), col2 ) ) DIV 37 FROM tab2 GROUP BY col1
................................................................................
2

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( ( 36 ), col0 + + col1, - col0 + + col0 ) * col0 AS col0 FROM tab1 GROUP BY col0, col2
----
1008
2952
792

................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-6376
SELECT DISTINCT + ( - col2 ) AS col0 FROM tab2 AS cor0 WHERE NOT ( - 1 * col2 ) <> ( 37 ) GROUP BY col2 HAVING ( col2 ) IN ( COALESCE ( + ( + COALESCE ( - 64, COUNT( * ) + ( col0 ) * 12 ) ), + COUNT( * ), COUNT( * ) / 97 ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6376
SELECT DISTINCT + ( - col2 ) AS col0 FROM tab2 AS cor0 WHERE NOT ( - 1 * col2 ) <> ( 37 ) GROUP BY col2 HAVING ( col2 ) IN ( COALESCE ( + ( + COALESCE ( - 64, COUNT ( * ) + ( col0 ) * 12 ) ), + COUNT ( * ), COUNT ( * ) / 97 ) )
----

onlyif mysql # CAST syntax: DECIMAL type: 
query I rowsort label-6377
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL ) NOT BETWEEN CAST( NULL AS DECIMAL ) AND ( - col1 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6377
SELECT + col0 AS col1 FROM tab0 AS cor0 GROUP BY col0 HAVING ( NULL ) NOT BETWEEN CAST ( NULL AS REAL ) AND ( - col1 )
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6378
SELECT + COUNT( * ) FROM tab2 AS cor0 GROUP BY col2 HAVING NOT CAST( NULL AS SIGNED ) NOT IN ( - 58 )
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-6437
SELECT DISTINCT - COUNT( * ) + - col0 + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL NOT BETWEEN + col2 * + NULLIF ( - - COUNT( * ), + col0 ) AND + CASE - col0 WHEN - col2 THEN + MIN( ALL + col2 ) WHEN COUNT( * ) * col0 THEN NULL END
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6437
SELECT DISTINCT - COUNT ( * ) + - col0 + + col0 AS col2 FROM tab2 AS cor0 GROUP BY col0 HAVING NULL NOT BETWEEN + col2 * + NULLIF ( - - COUNT ( * ), + col0 ) AND + CASE - col0 WHEN - col2 THEN + MIN ( ALL + col2 ) WHEN COUNT ( * ) * col0 THEN NULL END
----

onlyif mysql # aggregate syntax: 
query II rowsort label-6438
SELECT 10 AS col2, col2 FROM tab0 AS cor0 GROUP BY col2, col0 HAVING NOT - 67 * + ( - - COUNT( * ) ) <> + col2 - col0
................................................................................

skipif mysql # not compatible
query I rowsort label-6443
SELECT DISTINCT + SUM ( - + 28 ) FROM tab1 GROUP BY col0 HAVING NULL IS NULL
----
-28

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

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6445
SELECT - - col0 + + 94 + + col0 * col0 * CAST( + CAST( + 84 AS SIGNED ) AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY col0 HAVING ( + COUNT( * ) ) IS NULL
................................................................................

onlyif mysql # aggregate syntax: 
query II rowsort label-6560
SELECT DISTINCT - - col2 * + + col2 - - col2 + col2 col0, + 14 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - 18 NOT IN ( - COUNT( * ) )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6560
SELECT DISTINCT - - col2 * + + col2 - - col2 + col2 col0, + 14 AS col2 FROM tab2 AS cor0 GROUP BY col2 HAVING NOT - 18 NOT IN ( - COUNT ( * ) )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6561
SELECT - - SUM( + 56 ) AS col1 FROM tab2 AS cor0 GROUP BY col2 HAVING + 59 IS NOT NULL
................................................................................
SELECT + 23 DIV + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULLIF ( + ( CAST( NULL AS SIGNED ) ), CAST( - COUNT( 12 ) AS DECIMAL ) - col2 ) IS NOT NULL
----
0
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6618
SELECT + 23 / + col1 AS col2 FROM tab2 GROUP BY col1 HAVING NOT NULLIF ( + ( CAST ( NULL AS INTEGER ) ), CAST ( - COUNT ( 12 ) AS REAL ) - col2 ) IS NOT NULL
----
0
0
0

onlyif mysql # aggregate syntax: 
query I rowsort label-6619
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NOT ( NULL ) <> ( - COUNT( * ) + col0 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6619
SELECT DISTINCT col1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NOT ( NULL ) <> ( - COUNT ( * ) + col0 )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-6620
SELECT ALL + COUNT( * ) - + col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT + col1 IS NOT NULL
................................................................................
query I rowsort
SELECT 44 FROM tab2 cor0 GROUP BY col1
----
44
44
44

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + col2 AS col1 FROM tab2 WHERE NULL IS NOT NULL GROUP BY col2 HAVING NOT NULL <> - NULLIF ( + 3, + col1 )
----

query II rowsort
SELECT + ( - + ( - ( col0 ) ) ) AS col0, + 33 + - col2 FROM tab0 GROUP BY col2, col0
----
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6662
SELECT - 97 + AVG ( ( - + col1 ) ) + 33 + CAST( + 89 AS SIGNED ) / - col1 * - + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT - COUNT( * ) - ( + 5 ) * + col2 = NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6662
SELECT - 97 + AVG ( ( - + col1 ) ) + 33 + CAST ( + 89 AS INTEGER ) / - col1 * - + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1, col1 HAVING NOT - COUNT ( * ) - ( + 5 ) * + col2 = NULL
----

query I rowsort
SELECT - + col2 FROM tab0 AS cor0 WHERE ( NULL ) = NULL GROUP BY col2
----
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-6668
SELECT DISTINCT MIN( + - col0 ) + + 29 + - + col0 AS col1 FROM tab0 AS cor0 WHERE NOT 57 BETWEEN NULL AND - - col2 GROUP BY col2, col0, col0 HAVING NULL BETWEEN - col1 AND COUNT( * )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6668
SELECT DISTINCT MIN ( + - col0 ) + + 29 + - + col0 AS col1 FROM tab0 AS cor0 WHERE NOT 57 BETWEEN NULL AND - - col2 GROUP BY col2, col0, col0 HAVING NULL BETWEEN - col1 AND COUNT ( * )
----

query I rowsort
SELECT - col1 + + col1 + - 39 + col1 FROM tab0 GROUP BY col1
----
................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6707
SELECT DISTINCT CAST( NULL AS SIGNED ) col2, - 66 / - col1 * - col1 AS col2 FROM tab0 GROUP BY col0, col1 HAVING col1 + + col2 * - col0 NOT IN ( ( + CAST( NULL AS SIGNED ) ) / 44 + - 73 )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6707
SELECT DISTINCT CAST ( NULL AS INTEGER ) col2, - 66 / - col1 * - col1 AS col2 FROM tab0 GROUP BY col0, col1 HAVING col1 + + col2 * - col0 NOT IN ( ( + CAST ( NULL AS INTEGER ) ) / 44 + - 73 )
----

onlyif mysql # DIV for integer division: 
query II rowsort label-6708
SELECT + 80 DIV - - 8, + col1 col1 FROM tab2 GROUP BY col1, col2
................................................................................
SELECT ALL ( - - CASE + + 50 WHEN + col2 THEN NULL WHEN ( - 84 ) THEN col2 * + col0 ELSE COUNT( * ) * 39 END ) * + + col2 FROM tab0 GROUP BY col2
----
1482
3081
936

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6716
SELECT ALL ( - - CASE + + 50 WHEN + col2 THEN NULL WHEN ( - 84 ) THEN col2 * + col0 ELSE COUNT ( * ) * 39 END ) * + + col2 FROM tab0 GROUP BY col2
----
1482
3081
936

................................................................................
skipif mysql # not compatible
query II rowsort label-6789
SELECT DISTINCT - 54 / 27 AS col0, 74 FROM tab0 GROUP BY col0, col0
----
-2
74

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + NULLIF ( col0, - - 92 ) AS col2 FROM tab1 GROUP BY col0 HAVING NULL < - col2
----

query I rowsort
SELECT DISTINCT col1 FROM tab1 AS cor0 GROUP BY col1 HAVING ( NULL IS NULL )
----
................................................................................
SELECT - COALESCE ( - + 77, + COUNT( + col0 ), + + 2 + - + col1 - col2 + - SUM( DISTINCT - + 97 ) + - - col1 DIV - 77 * - col1 ) FROM tab0 GROUP BY col0, col1
----
77
77
77

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6808
SELECT - COALESCE ( - + 77, + COUNT ( + col0 ), + + 2 + - + col1 - col2 + - SUM ( DISTINCT - + 97 ) + - - col1 / - 77 * - col1 ) FROM tab0 GROUP BY col0, col1
----
77
77
77

................................................................................
NULL
4
NULL
4
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-6853
SELECT col0 / - - 20 col1, + COUNT ( * ) + + ( CAST ( NULL AS INTEGER ) ) FROM tab2 AS cor0 GROUP BY col0
----
0
NULL
4
NULL
................................................................................
SELECT - ( - 55 ) * - col2 + COALESCE ( 75, - CASE WHEN NOT + col0 IS NOT NULL THEN NULL WHEN NOT NULL NOT IN ( + 10 + ( + CAST( + 47 AS SIGNED ) ) ) THEN - col1 * + col2 END DIV - 62 ) * - col0 FROM tab2 GROUP BY col2, col0
----
-10090
-11170
-5910

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6913
SELECT - ( - 55 ) * - col2 + COALESCE ( 75, - CASE WHEN NOT + col0 IS NOT NULL THEN NULL WHEN NOT NULL NOT IN ( + 10 + ( + CAST ( + 47 AS INTEGER ) ) ) THEN - col1 * + col2 END / - 62 ) * - col0 FROM tab2 GROUP BY col2, col0
----
-10090
-11170
-5910

................................................................................
SELECT + COALESCE ( 92, col2 + + 40 * MAX( DISTINCT + 95 ) ) DIV col0 FROM tab1 GROUP BY col0
----
1
3
4

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6933
SELECT + COALESCE ( 92, col2 + + 40 * MAX ( DISTINCT + 95 ) ) / col0 FROM tab1 GROUP BY col0
----
1
3
4

................................................................................
22
-22
28
-28
82
-82

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - 20 col1, + 28 * + col0 + + col0 FROM tab2 GROUP BY col0, col0
----
-20
2639
-20
2668
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-6967
SELECT - COALESCE ( ( 53 ), COUNT( * ), - NULLIF ( - SUM( DISTINCT - CAST( NULL AS SIGNED ) ), CASE - col0 WHEN COUNT( * ) / - ( - col1 ) THEN - col2 - col0 ELSE - COALESCE ( col0, + 78 + + ( col2 ) * ( col0 ) ) * - col2 END ) ) FROM tab2 AS cor0 WHERE NOT - ( + ( col1 ) ) - + - col2 + col2 + - col2 + + - col2 * 74 + - col0 IS NOT NULL GROUP BY col0, col1
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-6967
SELECT - COALESCE ( ( 53 ), COUNT ( * ), - NULLIF ( - SUM ( DISTINCT - CAST ( NULL AS INTEGER ) ), CASE - col0 WHEN COUNT ( * ) / - ( - col1 ) THEN - col2 - col0 ELSE - COALESCE ( col0, + 78 + + ( col2 ) * ( col0 ) ) * - col2 END ) ) FROM tab2 AS cor0 WHERE NOT - ( + ( col1 ) ) - + - col2 + col2 + - col2 + + - col2 * 74 + - col0 IS NOT NULL GROUP BY col0, col1
----

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

onlyif mysql # CAST syntax: SIGNED type: 
query II rowsort label-6975
SELECT COALESCE ( - - 33, + ( + col2 ) * - + col1 * + + col0 * + - 9 * col1 - - + col1 + col2 * NULLIF ( + col2, - + col1 * CAST( col2 AS SIGNED ) ) ) * - - 6, + 23 + - col1 + - col1 * + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-6975
SELECT COALESCE ( - - 33, + ( + col2 ) * - + col1 * + + col0 * + - 9 * col1 - - + col1 + col2 * NULLIF ( + col2, - + col1 * CAST ( col2 AS INTEGER ) ) ) * - - 6, + 23 + - col1 + - col1 * + col1 AS col2 FROM tab0 AS cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query II rowsort label-6976
SELECT + ( - + COUNT( * ) ) DIV - 83 * - 76 * - col2 - col2, col2 + - - 10 AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING NOT ( NULL ) IS NOT NULL
................................................................................
NULL
-2337
NULL
-246
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7026
SELECT ALL - 41 * col1 col1, 88 + col1 * CAST ( NULL AS REAL ) AS col1 FROM tab1 AS cor0 GROUP BY col1, col0
----
-1804
NULL
-2337
NULL
................................................................................
SELECT CASE - CAST( NULL AS SIGNED ) WHEN - 14 * - col0 + - - 3 + + col1 THEN + + 94 * col2 ELSE NULL END FROM tab0 GROUP BY col1, col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7078
SELECT CASE - CAST ( NULL AS INTEGER ) WHEN - 14 * - col0 + - - 3 + + col1 THEN + + 94 * col2 ELSE NULL END FROM tab0 GROUP BY col1, col0
----
NULL
NULL
NULL

................................................................................

query I rowsort
SELECT DISTINCT col1 * 40 FROM tab0 WHERE NOT NULL IS NOT NULL GROUP BY col1
----
0
3240

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + 96, + - col2 * - 1 ) FROM tab2 GROUP BY col1
----
96
96
96

................................................................................
----

skipif mysql # not compatible
query I rowsort label-7203
SELECT DISTINCT - 1 AS col0 FROM tab0 GROUP BY col1, col1 HAVING NOT ( COUNT ( * ) IS NOT 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 - 81 * - - col2 < NULL
----

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7205
SELECT ALL COUNT( * ) + + col2 * + 93 + + + col2 * + col2 + CAST( NULL AS SIGNED ) + + MIN( - col2 ) / + col2 AS col1 FROM tab1 GROUP BY col2, col2
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: DECIMAL type: 
query I rowsort label-7221
SELECT ALL + col0 * + COALESCE ( - - MAX( ALL col1 ), - 55 ) AS col2 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NULL AND NOT ( NULL ) BETWEEN ( - CAST( 96 AS DECIMAL ) ) AND - 45 * CASE COUNT( - 11 ) / - SUM( + col0 ) WHEN 1 THEN - col0 ELSE NULL END - col2
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7221
SELECT ALL + col0 * + COALESCE ( - - MAX ( ALL col1 ), - 55 ) AS col2 FROM tab2 GROUP BY col0 HAVING NOT ( NULL ) IS NULL AND NOT ( NULL ) BETWEEN ( - CAST ( 96 AS REAL ) ) AND - 45 * CASE COUNT ( - 11 ) / - SUM ( + col0 ) WHEN 1 THEN - col0 ELSE NULL END - col2
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7222
SELECT DISTINCT CAST( NULL AS SIGNED ) * CAST( NULL AS SIGNED ) + + 13 - col0 * + col0 - - ( - 64 ) * col2 + 95 AS col1 FROM tab1 WHERE NULL IS NOT NULL GROUP BY col2, col1, col0 HAVING NULL NOT BETWEEN - col1 AND NULL
................................................................................
----

skipif mysql # not compatible
query I rowsort label-7237
SELECT col1 FROM tab1 GROUP BY col1 HAVING - - COUNT ( * ) + + col1 + + 13 < + 12
----

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( - 59, + 39 * + col2 * - 15 ) + + - col0 + + 91 * + - 10 + - col0 AS col1 FROM tab1 AS cor0 GROUP BY col0
----
-1013
-1025
-1133

................................................................................
skipif mysql # not compatible
query I rowsort label-7321
SELECT ALL + + 51 + - + 36 + - COUNT ( * ) - + 32 FROM tab0 AS cor0 GROUP BY col1
----
-18
-19

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT ALL - col1 col1, ( + - col1 ) AS col1 FROM tab0 AS cor0 GROUP BY col1
----
-81
-81
0
0
................................................................................
SELECT + COALESCE ( - 31, + - col0 DIV - col1 + + col1, - 64, CAST( NULL AS SIGNED ) ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-31
-31
-31

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7356
SELECT + COALESCE ( - 31, + - col0 / - col1 + + col1, - 64, CAST ( NULL AS INTEGER ) ) AS col1 FROM tab1 AS cor0 GROUP BY col2
----
-31
-31
-31

................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7477
SELECT ALL col2 - col2 * COALESCE ( + 54, - col1 * CAST( - - 33 AS SIGNED ) * - col0 * - col2 + - - 55 - - 27 + MAX( - col0 ) + + - CAST( NULL AS SIGNED ) / - + COALESCE ( col1, col0 + - col2, + NULLIF ( col1, + NULLIF ( 19, 46 / 46 ) ) * ( 63 ) ) + col2, + 51 ) + MIN( DISTINCT col2 ) AS col1 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL NOT BETWEEN ( col1 + COUNT( * ) ) AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7477
SELECT ALL col2 - col2 * COALESCE ( + 54, - col1 * CAST ( - - 33 AS INTEGER ) * - col0 * - col2 + - - 55 - - 27 + MAX ( - col0 ) + + - CAST ( NULL AS INTEGER ) / - + COALESCE ( col1, col0 + - col2, + NULLIF ( col1, + NULLIF ( 19, 46 / 46 ) ) * ( 63 ) ) + col2, + 51 ) + MIN ( DISTINCT col2 ) AS col1 FROM tab0 GROUP BY col2, col2 HAVING NOT NULL NOT BETWEEN ( col1 + COUNT ( * ) ) AND NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7478
SELECT - col2 + - COUNT( ( 65 ) ) + + col0 + col2 * - + col0 FROM tab2 GROUP BY col0, col2
................................................................................
-1694
-28
-2156
-82
-6314

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7532
SELECT - col0 col2, - col0 * - NULLIF ( - COALESCE ( 77, 7 ), col0 + - CAST ( NULL AS INTEGER ) ) AS col2 FROM tab1 GROUP BY col2, col0
----
-22
-1694
-28
-2156
................................................................................
query I rowsort
SELECT - col1 FROM tab1 AS cor0 WHERE + col2 IS NOT NULL GROUP BY col1
----
-44
-57
-6

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - col1 + + AVG ( + 55 ) AS col2 FROM tab1 GROUP BY col0, col1 HAVING NOT ( col2 * + 67 <> NULL )
----

query I rowsort
SELECT - col2 AS col2 FROM tab0 cor0 GROUP BY col1, col2
----
................................................................................
70
41
70
59
70
61

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

onlyif mysql # aggregate syntax: 
query II rowsort label-7626
SELECT col1 col1, + col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT + COUNT( * ) IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7626
SELECT col1 col1, + col1 AS col1 FROM tab0 GROUP BY col1 HAVING NOT + COUNT ( * ) IS NOT NULL
----

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

query I rowsort
SELECT 45 * + + col1 + col1 AS col2 FROM tab1 GROUP BY col1 HAVING NULL <= - 98 + - 30 * 48
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT - col1 + - + col1 col0, col1 - - col1 * col1 AS col2 FROM tab2 GROUP BY col1
----
-118
3540
-122
3782
................................................................................
----

skipif mysql # not compatible
query I rowsort label-7736
SELECT DISTINCT ( + - SUM ( DISTINCT - + 34 ) ) * + col0 / - + col1 * + COUNT ( - 53 ) + - COUNT ( ( - col1 ) + col1 ) FROM tab1 AS cor0 WHERE NOT - col2 + + - 16 + + col2 + - col0 >= col0 GROUP BY col0, col1 HAVING NOT + 56 - - SUM ( + col2 ) <= NULL
----

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT DISTINCT - col0 col2, - 18 * + + col0 - - 77 AS col1 FROM tab2 AS cor0 GROUP BY col0, col0 HAVING NULL IS NULL
----
-15
-193
-91
-1561
................................................................................
onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-7773
SELECT DISTINCT + 26 / + + COUNT( * ) * - ( - + CAST( NULL AS SIGNED ) ) * + col2 + + CAST( NULL AS SIGNED ) * COALESCE ( + 19, - col2 + + col0 ) + - col2 FROM tab0 GROUP BY col2
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7773
SELECT DISTINCT + 26 / + + COUNT ( * ) * - ( - + CAST ( NULL AS INTEGER ) ) * + col2 + + CAST ( NULL AS INTEGER ) * COALESCE ( + 19, - col2 + + col0 ) + - col2 FROM tab0 GROUP BY col2
----
NULL

onlyif mysql # DIV for integer division: 
query II rowsort label-7774
................................................................................
-71
-8

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

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT + 54 * + col1 * col1 col1, - 5 + + col1 AS col1 FROM tab1 AS cor0 GROUP BY col1 HAVING NOT col1 IS NULL
----
104544
39
175446
52
................................................................................
SELECT COALESCE ( - 54, + 91 + ( - - col1 ) * + 25 DIV + col2 * col2 - - + 77 ) FROM tab1 GROUP BY col0
----
-54
-54
-54

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7829
SELECT COALESCE ( - 54, + 91 + ( - - col1 ) * + 25 / + col2 * col2 - - + 77 ) FROM tab1 GROUP BY col0
----
-54
-54
-54

onlyif mysql # aggregate syntax: 
query II rowsort label-7830
SELECT ALL + col1 col1, col1 + - 1 * - + COUNT( * ) * + + MIN( + col1 ) AS col1 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) > - 86
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-7830
SELECT ALL + col1 col1, col1 + - 1 * - + COUNT ( * ) * + + MIN ( + col1 ) AS col1 FROM tab2 GROUP BY col1 HAVING NOT ( NULL ) > - 86
----

onlyif mysql # aggregate syntax: 
query I rowsort label-7831
SELECT DISTINCT - + COUNT( * ) AS col0 FROM tab1 AS cor0 GROUP BY col1
................................................................................

skipif mysql # not compatible
query I rowsort label-7839
SELECT DISTINCT + ( + col0 ) * - col0 / - CAST ( - CAST ( NULL AS INTEGER ) AS INTEGER ) + 3 * + - col0 * - col0 AS col0 FROM tab1 GROUP BY col0
----
NULL

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort
SELECT ALL col0 * - - ( ( - + 20 ) ) * + COALESCE ( + 88, + + col2 ) + col0, col0 AS col2 FROM tab1 GROUP BY col0
----
-144238
82
-38698
22
................................................................................
SELECT COALESCE ( - + 20, COUNT( * ) + - CASE + col0 WHEN col2 * + NULLIF ( NULLIF ( COALESCE ( - col1, 62 * - 42 ), 41 * col2 ), + CAST( - col1 AS SIGNED ) * MIN( CAST( NULL AS SIGNED ) + CASE col2 WHEN 81 + col1 THEN + col1 END ) ) * - col0 + COUNT( * ) THEN NULL WHEN + CAST( - ( + CAST( COUNT( * ) AS SIGNED ) ) AS SIGNED ) * - 99 THEN 66 ELSE NULL END + + col1 ) FROM tab0 GROUP BY col2, col1
----
-20
-20
-20

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7984
SELECT COALESCE ( - + 20, COUNT ( * ) + - CASE + col0 WHEN col2 * + NULLIF ( NULLIF ( COALESCE ( - col1, 62 * - 42 ), 41 * col2 ), + CAST ( - col1 AS INTEGER ) * MIN ( CAST ( NULL AS INTEGER ) + CASE col2 WHEN 81 + col1 THEN + col1 END ) ) * - col0 + COUNT ( * ) THEN NULL WHEN + CAST ( - ( + CAST ( COUNT ( * ) AS INTEGER ) ) AS INTEGER ) * - 99 THEN 66 ELSE NULL END + + col1 ) FROM tab0 GROUP BY col2, col1
----
-20
-20
-20

................................................................................
-22
90
-28
90
-82

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8034
SELECT + 90 col1, + ( + MIN ( ALL - + col0 ) ) FROM tab1 cor0 GROUP BY col1, col1, col0
----
90
-22
90
-28
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query II rowsort label-8106
SELECT DISTINCT - 33 + + col2 * MAX( 25 ), - col1 + + col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING + col1 - CASE + col0 WHEN - col0 * + 10 THEN CASE + CASE WHEN col1 > col1 * + col2 + 78 * + 17 + - + col2 THEN NULL ELSE + COUNT( * ) END WHEN + - col1 * - col0 THEN - COUNT( DISTINCT + col1 ) * - COALESCE ( - 43, + COUNT( * ), + + col1 ) / - + AVG ( + - col0 ) ELSE + - 74 + col2 / - CAST( NULL AS SIGNED ) END * col2 + + col2 ELSE - 58 * + 40 + col2 END >= ( NULL )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query II rowsort label-8106
SELECT DISTINCT - 33 + + col2 * MAX ( 25 ), - col1 + + col1 AS col0 FROM tab0 GROUP BY col1, col2 HAVING + col1 - CASE + col0 WHEN - col0 * + 10 THEN CASE + CASE WHEN col1 > col1 * + col2 + 78 * + 17 + - + col2 THEN NULL ELSE + COUNT ( * ) END WHEN + - col1 * - col0 THEN - COUNT ( DISTINCT + col1 ) * - COALESCE ( - 43, + COUNT ( * ), + + col1 ) / - + AVG ( + - col0 ) ELSE + - 74 + col2 / - CAST ( NULL AS INTEGER ) END * col2 + + col2 ELSE - 58 * + 40 + col2 END >= ( NULL )
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8107
SELECT + - COUNT( * ) FROM tab1 AS cor0 GROUP BY col0, col0 HAVING ( NULL ) = NULL
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-8132
SELECT ALL - MAX( DISTINCT + + col1 ) - + col1 * + - col1 + + col1 * + col1 * - COALESCE ( - 89, - + col1 * - + col2, + - NULLIF ( + COUNT( 65 ), + 21 + + col1 ) * - - col2 + col0 ) FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8132
SELECT ALL - MAX ( DISTINCT + + col1 ) - + col1 * + - col1 + + col1 * + col1 * - COALESCE ( - 89, - + col1 * - + col2, + - NULLIF ( + COUNT ( 65 ), + 21 + + col1 ) * - - col2 + col0 ) FROM tab0 cor0 GROUP BY col1 HAVING NULL IS NOT NULL
----

query I rowsort
SELECT + 22 * - col0 / - col2 AS col0 FROM tab0 GROUP BY col0, col0, col2 HAVING NOT + col0 * col0 * col2 + 78 > NULL
----
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8249
SELECT + NULLIF ( - - ( - CAST( NULL AS SIGNED ) ), + col1 + col0 * - 14 * + CAST( + COUNT( * ) AS SIGNED ) ) + + - MIN( + col1 ) + + col1 FROM tab0 GROUP BY col1 HAVING NOT + 0 IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8249
SELECT + NULLIF ( - - ( - CAST ( NULL AS INTEGER ) ), + col1 + col0 * - 14 * + CAST ( + COUNT ( * ) AS INTEGER ) ) + + - MIN ( + col1 ) + + col1 FROM tab0 GROUP BY col1 HAVING NOT + 0 IS NOT NULL
----

query I rowsort
SELECT + - ( - + col1 ) + + + 0 * - col1 * - 16 AS col0 FROM tab1 AS cor0 GROUP BY col1, col1
----
................................................................................
SELECT + NULLIF ( - ( CAST( NULL AS SIGNED ) ), - + col2 ) + + col1 - ( - col1 ) FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8258
SELECT + NULLIF ( - ( CAST ( NULL AS INTEGER ) ), - + col2 ) + + col1 - ( - col1 ) FROM tab1 AS cor0 GROUP BY col1, col1
----
NULL
NULL
NULL

................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: DECIMAL type: 
query I rowsort label-8317
SELECT ALL CASE - col0 WHEN 57 * SUM( - + col0 ) THEN NULL WHEN - - 91 THEN - col1 ELSE NULL END AS col2 FROM tab2 GROUP BY col1, col0 HAVING NOT + 6 * + - col0 + CAST( + COUNT( * ) AS DECIMAL ) * - col2 >= - - CAST( NULL AS SIGNED )
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8317
SELECT ALL CASE - col0 WHEN 57 * SUM ( - + col0 ) THEN NULL WHEN - - 91 THEN - col1 ELSE NULL END AS col2 FROM tab2 GROUP BY col1, col0 HAVING NOT + 6 * + - col0 + CAST ( + COUNT ( * ) AS REAL ) * - col2 >= - - CAST ( NULL AS INTEGER )
----

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

skipif mysql # not compatible
query II rowsort label-8338
SELECT + col2 AS col1, 16 * - MAX ( ALL - col2 ) * + + col2 * + - ( - - 16 ) AS col1 FROM tab2 WHERE NOT + CASE - col1 WHEN - ( + 14 ) THEN + 99 END IS NOT NULL GROUP BY col2 HAVING NOT ( NULL ) = - 22 + + col2
----

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

onlyif mysql # aggregate syntax: 
query I rowsort label-8340
SELECT MAX( 60 ) * + SUM( - + col1 ) + - col1 + + COUNT( * ) AS col0 FROM tab0 GROUP BY col1
................................................................................
13

query I rowsort
SELECT DISTINCT - 5 AS col0 FROM tab1 GROUP BY col2, col2
----
-5

skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort
SELECT col0 col0, + 6 FROM tab0 GROUP BY col0 HAVING NOT 84 IS NOT NULL
----

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8393
SELECT DISTINCT CAST( - CAST( NULL AS SIGNED ) AS SIGNED ) * + col2 FROM tab2 GROUP BY col2
................................................................................
1
-59
1
-61
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8404
SELECT ALL - col1 col1, + COUNT ( * ) FROM tab2 AS cor0 GROUP BY col1
----
-41
1
-59
1
................................................................................

onlyif mysql # CAST syntax: aggregate syntax: SIGNED type: 
query I rowsort label-8428
SELECT + COALESCE ( + - 66, col0 + 1 + - - col1 ) + + CAST( + COUNT( * ) AS SIGNED ) + - 64 + + + 20 * - col1 + - - COUNT( DISTINCT + col1 ) * - col1 / COUNT( * ) * - col1 / 8 FROM tab0 WHERE NOT - - col0 IS NOT NULL GROUP BY col1 HAVING NULL <> NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8428
SELECT + COALESCE ( + - 66, col0 + 1 + - - col1 ) + + CAST ( + COUNT ( * ) AS INTEGER ) + - 64 + + + 20 * - col1 + - - COUNT ( DISTINCT + col1 ) * - col1 / COUNT ( * ) * - col1 / 8 FROM tab0 WHERE NOT - - col0 IS NOT NULL GROUP BY col1 HAVING NULL <> NULL
----

query I rowsort
SELECT - col2 FROM tab2 WHERE NOT + - 1 IS NULL GROUP BY col2
----
................................................................................
SELECT + 87 / col2 / col2 FROM tab0 GROUP BY col2 HAVING NOT ( NULL ) IS NULL
----

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

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

................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-8503
SELECT DISTINCT - + 1 * COALESCE ( - 46, - + COUNT( * ) ) / 79 + col2 - - col2 / AVG ( ALL - + 1 ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING COUNT( * ) * - col1 = NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8503
SELECT DISTINCT - + 1 * COALESCE ( - 46, - + COUNT ( * ) ) / 79 + col2 - - col2 / AVG ( ALL - + 1 ) AS col1 FROM tab0 AS cor0 GROUP BY col2 HAVING COUNT ( * ) * - col1 = NULL
----

onlyif mysql # aggregate syntax: 
query I rowsort label-8504
SELECT ALL - col0 AS col1 FROM tab2 AS cor0 GROUP BY col0 HAVING - COUNT( * ) NOT IN ( - COUNT( * ), 88, COUNT( * ) )
................................................................................
SELECT ALL - + CASE + 33 WHEN - - 67 THEN col0 ELSE - CAST( - col1 AS SIGNED ) END * - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
2565
3124
48

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8518
SELECT ALL - + CASE + 33 WHEN - - 67 THEN col0 ELSE - CAST ( - col1 AS INTEGER ) END * - col2 AS col2 FROM tab1 AS cor0 GROUP BY col2, col1
----
2565
3124
48

................................................................................

onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-8529
SELECT + col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NULL <> - - CAST( + + col1 AS SIGNED ) + 42 + - col1 + - 16
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8529
SELECT + col0 AS col1 FROM tab1 cor0 GROUP BY col0 HAVING NULL <> - - CAST ( + + col1 AS INTEGER ) + 42 + - col1 + - 16
----

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

onlyif mysql # aggregate syntax: 
query II rowsort label-8593
SELECT ALL + col1 col1, - col1 AS col2 FROM tab1 WHERE NOT NULL < NULL GROUP BY col1 HAVING NOT + COUNT( * ) NOT BETWEEN NULL AND NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8593
SELECT ALL + col1 col1, - col1 AS col2 FROM tab1 WHERE NOT NULL < NULL GROUP BY col1 HAVING NOT + COUNT ( * ) NOT BETWEEN NULL AND NULL
----

query I rowsort
SELECT col2 * + 40 AS col1 FROM tab1 GROUP BY col2
----
................................................................................

onlyif mysql # aggregate syntax: 
query II rowsort label-8622
SELECT DISTINCT col0 + col1 col0, - ( 71 ) + + COUNT( * ) * col0 * + + ( + 33 ) FROM tab2 GROUP BY col1, col0 HAVING ( NULL ) IS NOT NULL
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL requires AS when renaming output columns
query II rowsort label-8622
SELECT DISTINCT col0 + col1 col0, - ( 71 ) + + COUNT ( * ) * col0 * + + ( + 33 ) FROM tab2 GROUP BY col1, col0 HAVING ( NULL ) IS NOT NULL
----

onlyif mysql # aggregate syntax: DIV for integer division: 
query I rowsort label-8623
SELECT + COUNT( * ) DIV + - 99 - COUNT( * ) FROM tab1 AS cor0 GROUP BY col2
................................................................................

onlyif mysql # aggregate syntax: 
query I rowsort label-8660
SELECT DISTINCT - 54 AS col2 FROM tab0 GROUP BY col0 HAVING NULL BETWEEN ( ( - col2 ) ) * - - COUNT( * ) AND - - 79
----

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8660
SELECT DISTINCT - 54 AS col2 FROM tab0 GROUP BY col0 HAVING NULL BETWEEN ( ( - col2 ) ) * - - COUNT ( * ) AND - - 79
----

onlyif mysql # DIV for integer division: 
query I rowsort label-8661
SELECT ALL col0 DIV col0 * - - col0 * col0 AS col0 FROM tab2 GROUP BY col0
................................................................................
query I rowsort
SELECT + 69 FROM tab1 GROUP BY col0
----
69
69
69

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( + 60, - + col1, + col2 ) FROM tab1 AS cor0 GROUP BY col2
----
60

query I rowsort
SELECT + 37 FROM tab2 AS cor0 GROUP BY col1, col1
................................................................................
query I rowsort
SELECT DISTINCT 39 + + col2 FROM tab1 GROUP BY tab1.col2
----
110
47
84

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( + 26, + cor0.col2 + cor0.col0 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
-26
-26
-26

................................................................................
4

query I rowsort
SELECT DISTINCT + 59 FROM tab2 cor0 GROUP BY cor0.col0
----
59

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( + 80, col0 ) * + cor0.col1 FROM tab2 cor0 GROUP BY cor0.col2, cor0.col1
----
-3280
-4720
-4880

Changes to test/random/groupby/slt_good_13.test.

1172
1173
1174
1175
1176
1177
1178

1179
1180
1181
1182
1183
1184
1185
....
2648
2649
2650
2651
2652
2653
2654

2655
2656
2657
2658
2659
2660
2661
....
4374
4375
4376
4377
4378
4379
4380

4381
4382
4383
4384
4385
4386
4387
....
6232
6233
6234
6235
6236
6237
6238

6239
6240
6241
6242
6243
6244
6245
....
8064
8065
8066
8067
8068
8069
8070

8071
8072
8073
8074
8075
8076
8077
....
8895
8896
8897
8898
8899
8900
8901

8902
8903
8904
8905
8906
8907
8908
.....
10408
10409
10410
10411
10412
10413
10414

10415
10416
10417
10418
10419
10420
10421
.....
12159
12160
12161
12162
12163
12164
12165

12166
12167
12168
12169
12170
12171
12172
.....
12988
12989
12990
12991
12992
12993
12994

12995
12996
12997
12998
12999
13000
13001
.....
14938
14939
14940
14941
14942
14943
14944

14945
14946
14947
14948
14949
14950
14951
.....
14975
14976
14977
14978
14979
14980
14981

14982
14983
14984
14985
14986
14987
14988
.....
15101
15102
15103
15104
15105
15106
15107

15108
15109
15110
15111
15112
15113
15114
.....
22860
22861
22862
22863
22864
22865
22866

22867
22868
22869
22870
22871
22872
22873
22874
22875
22876
22877
22878
22879

22880
22881
22882
22883
22884
22885
22886
.....
22898
22899
22900
22901
22902
22903
22904

22905
22906
22907
22908
22909
22910
22911

22912
22913
22914
22915
22916
22917
22918
.....
22919
22920
22921
22922
22923
22924
22925

22926
22927
22928
22929
22930
22931
22932
.....
22948
22949
22950
22951
22952
22953
22954

22955
22956
22957
22958
22959
22960
22961
22962
22963
22964
22965
22966
22967

22968
22969
22970
22971
22972
22973
22974

22975
22976
22977
22978
22979
22980
22981
.....
23000
23001
23002
23003
23004
23005
23006

23007
23008
23009
23010
23011
23012
23013
.....
23033
23034
23035
23036
23037
23038
23039

23040
23041
23042
23043
23044
23045
23046
.....
23084
23085
23086
23087
23088
23089
23090

23091
23092
23093
23094
23095
23096
23097
.....
23099
23100
23101
23102
23103
23104
23105

23106
23107
23108
23109
23110
23111
23112
.....
23175
23176
23177
23178
23179
23180
23181

23182
23183
23184
23185
23186
23187
23188

23189
23190
23191
23192
23193
23194
23195
.....
23235
23236
23237
23238
23239
23240
23241

23242
23243
23244
23245
23246
23247
23248
.....
23255
23256
23257
23258
23259
23260
23261

23262
23263
23264
23265
23266
23267
23268
.....
23269
23270
23271
23272
23273
23274
23275

23276
23277
23278
23279
23280
23281
23282
.....
23299
23300
23301
23302
23303
23304
23305

23306
23307
23308
23309
23310
23311
23312
query I rowsort
SELECT - cor0.col1 + 92 FROM tab2 AS cor0 GROUP BY cor0.col1
----
31
33
51


query I rowsort
SELECT DISTINCT COALESCE ( + 59, - cor0.col0 * + cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col1
----
59

onlyif mysql # DIV for integer division: 
query I rowsort label-159
................................................................................
query I rowsort
SELECT 56 FROM tab2 AS cor0 GROUP BY cor0.col0
----
56
56
56


query I rowsort
SELECT DISTINCT COALESCE ( - 79, - cor0.col0 ) FROM tab2 cor0 GROUP BY cor0.col1
----
-79

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


query I rowsort
SELECT ALL - COALESCE ( 55, cor0.col2 ) AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-55
-55
-55

................................................................................
query I rowsort
SELECT ALL - tab1.col1 + - 90 * - 72 FROM tab1 GROUP BY col1
----
6423
6436
6474


query I rowsort
SELECT COALESCE ( - 48, cor0.col0 ) AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-48
-48
-48

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


query I rowsort
SELECT - COALESCE ( 27, cor0.col0 + - col2 ) * + 32 FROM tab0 AS cor0 GROUP BY col1
----
-864
-864

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


query I rowsort
SELECT COALESCE ( + 97, cor0.col2 ) + + cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
178
97

query I rowsort
................................................................................
query I rowsort
SELECT 30 FROM tab1 AS cor0 GROUP BY cor0.col1
----
30
30
30


query I rowsort
SELECT + COALESCE ( + 47, - cor0.col0 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
47
47
47

................................................................................
89

query I rowsort
SELECT DISTINCT ( 83 ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
83


query I rowsort
SELECT DISTINCT + COALESCE ( 60, tab0.col0 ) FROM tab0 GROUP BY tab0.col1
----
60

query I rowsort
SELECT + 72 * 16 FROM tab1 AS cor0 GROUP BY cor0.col2
................................................................................

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


query I rowsort
SELECT DISTINCT COALESCE ( + 81, cor0.col0 ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
81

query I rowsort
SELECT 29 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
................................................................................
-5440

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


query I rowsort
SELECT + COALESCE ( 6, cor0.col2 ) + - cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-85
-86
-9

................................................................................
query I rowsort
SELECT ALL - NULLIF ( - cor0.col0, cor0.col0 * col1 ) FROM tab1 AS cor0 GROUP BY cor0.col0, col1
----
22
28
82


query I rowsort
SELECT ALL + 15 * COALESCE ( + 58, tab2.col0 ) FROM tab2 GROUP BY tab2.col2
----
870
870
870

................................................................................
query I rowsort label-2039
SELECT DISTINCT + 8 * - tab1.col2 * tab1.col2 - + 39 / 10 FROM tab1 GROUP BY tab1.col2
----
-16203
-40331
-515


query I rowsort
SELECT ALL COALESCE ( + 5, + tab1.col1 ) AS col1 FROM tab1, tab0 AS cor0 GROUP BY cor0.col2
----
5
5
5

................................................................................
query I rowsort label-3085
SELECT cor0.col1 * + CAST( + COALESCE ( + 7, cor0.col2 ) AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
567

skipif mysql # not compatible

query I rowsort label-3085
SELECT cor0.col1 * + CAST ( + COALESCE ( + 7, cor0.col2 ) AS INTEGER ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
567

query I rowsort
SELECT - cor0.col1 + COALESCE ( 3, col0 ) * + col0 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col0, col0
----
-16
214
235


query I rowsort
SELECT DISTINCT - COALESCE ( - 6, cor0.col1, + cor0.col0 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
6

query I rowsort
SELECT ALL 57 * - COALESCE ( cor0.col0, - cor0.col1, NULLIF ( + cor0.col2, + cor0.col0 ) ) AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, col0, cor0.col2
................................................................................
query I rowsort
SELECT DISTINCT 62 * COALESCE ( - 12 * - col2, - cor0.col1, 84 * + cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
43152
58776
64728


query I rowsort
SELECT ALL cor0.col2 * - COALESCE ( - 91, cor0.col1 * cor0.col1, + 73 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
4095
6461
728


query I rowsort
SELECT - cor0.col1 * COALESCE ( + 75, cor0.col1, - cor0.col2, col0 ) FROM tab1 AS cor0 GROUP BY cor0.col1
----
-3300
-4275
-450

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


query I rowsort
SELECT ALL - COALESCE ( 25, cor0.col0 ) + 12 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-13
-13
-13

................................................................................
query I rowsort label-3097
SELECT DISTINCT + 43 * cor0.col1 + cor0.col1 * CAST( COALESCE ( 43, - col2 ) AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
6966

skipif mysql # not compatible

query I rowsort label-3097
SELECT DISTINCT + 43 * cor0.col1 + cor0.col1 * CAST ( COALESCE ( 43, - col2 ) AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
6966

query I rowsort
SELECT ALL COALESCE ( + 73, + cor0.col2 ) FROM tab0 AS cor0 GROUP BY cor0.col2
----
73
73
73


query I rowsort
SELECT COALESCE ( + 97, cor0.col0, + cor0.col0 ) * cor0.col1 * 54 FROM tab2 AS cor0 GROUP BY col1, cor0.col2
----
214758
309042
319518


query I rowsort
SELECT DISTINCT - COALESCE ( 41, + cor0.col1 ) FROM tab1 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor1.col0, cor1.col1
----
-41

query I rowsort
SELECT - COALESCE ( cor0.col1, cor0.col1 ) * cor0.col1 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
................................................................................
onlyif mysql # DIV for integer division: 
query I rowsort label-3104
SELECT DISTINCT - cor0.col0 * COALESCE ( + 24, - cor0.col0 + + cor0.col2 ) DIV cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col0
----
-24

skipif mysql # not compatible

query I rowsort label-3104
SELECT DISTINCT - cor0.col0 * COALESCE ( + 24, - cor0.col0 + + cor0.col2 ) / cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col0
----
-24

query I rowsort
SELECT + COALESCE ( + 36, cor0.col1 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT + col1 * + cor0.col2 + COALESCE ( cor0.col1 + cor0.col1, 40, + cor0.col2 ) * + 31 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
0
0
6966


query I rowsort
SELECT DISTINCT + COALESCE ( NULLIF ( + cor0.col0, - cor0.col0 ) * 43, 52, cor0.col1 + cor0.col2 * cor0.col0 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
3913
3956
645

................................................................................
query I rowsort
SELECT ALL COALESCE ( 75, cor0.col0 + cor0.col0 * - 85 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
75
75
75


query I rowsort
SELECT ALL - COALESCE ( 40, cor0.col0, + cor0.col1, cor0.col0 ) + + col2 FROM tab1 AS cor0 GROUP BY col2, cor0.col1
----
-32
31
5

................................................................................
query I rowsort label-3116
SELECT DISTINCT + COALESCE ( 42, cor0.col0 ) DIV + cor0.col2 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
0
1

skipif mysql # not compatible

query I rowsort label-3116
SELECT DISTINCT + COALESCE ( 42, cor0.col0 ) / + cor0.col2 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
0
1

query I rowsort
................................................................................
query I rowsort
SELECT ALL col2 * - COALESCE ( 91 * cor0.col1, + cor0.col2, + cor0.col1 * cor0.col1 ) AS col1 FROM tab1 cor0 GROUP BY cor0.col0, col2, cor0.col1
----
-233415
-284284
-4368


query I rowsort
SELECT DISTINCT - COALESCE ( 80, + cor0.col2, + col0 ) - cor0.col0 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-171
-172
-95


query I rowsort
SELECT DISTINCT COALESCE ( 16, cor0.col1 ) AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
16

query I rowsort
SELECT + COALESCE ( 46 + + cor0.col1, NULLIF ( 22, cor0.col1 ), + cor0.col1 ) AS col1 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col1
................................................................................
query I rowsort
SELECT DISTINCT COALESCE ( cor0.col0, + 5 ) + cor0.col1 FROM tab2 cor0 GROUP BY cor0.col1, cor0.col0
----
133
150
76


query I rowsort
SELECT ALL + COALESCE ( + 64, + col2 ) + + tab0.col0 FROM tab0 GROUP BY tab0.col0
----
107
147
90

................................................................................
query I rowsort
SELECT + COALESCE ( + 12 + cor0.col1, ( 51 ) * cor0.col1 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col1
----
53
71
73


query I rowsort
SELECT ALL + COALESCE ( + 12, cor0.col1, cor0.col0, cor0.col0 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
12
12
12

................................................................................
query I rowsort
SELECT ALL COALESCE ( 53, cor0.col2 * + ( 19 ) ) AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
53
53
53


query I rowsort
SELECT DISTINCT COALESCE ( + 99, - tab2.col2 ) AS col2 FROM tab2 GROUP BY col0
----
99

onlyif mysql # DIV for integer division: 
query I rowsort label-3138
................................................................................
SELECT COALESCE ( - 83, + cor0.col1 ) DIV - col0 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
1
1
3

skipif mysql # not compatible

query I rowsort label-3139
SELECT COALESCE ( - 83, + cor0.col1 ) / - col0 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
1
1
3








>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>













>







 







>







>







 







>







 







>













>







>







 







>







 







>







 







>







 







>







 







>







>







 







>







 







>







 







>







 







>







1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
....
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
....
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
....
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
....
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
....
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
.....
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
.....
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
.....
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
.....
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
.....
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
.....
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
.....
22872
22873
22874
22875
22876
22877
22878
22879
22880
22881
22882
22883
22884
22885
22886
22887
22888
22889
22890
22891
22892
22893
22894
22895
22896
22897
22898
22899
22900
.....
22912
22913
22914
22915
22916
22917
22918
22919
22920
22921
22922
22923
22924
22925
22926
22927
22928
22929
22930
22931
22932
22933
22934
.....
22935
22936
22937
22938
22939
22940
22941
22942
22943
22944
22945
22946
22947
22948
22949
.....
22965
22966
22967
22968
22969
22970
22971
22972
22973
22974
22975
22976
22977
22978
22979
22980
22981
22982
22983
22984
22985
22986
22987
22988
22989
22990
22991
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
.....
23020
23021
23022
23023
23024
23025
23026
23027
23028
23029
23030
23031
23032
23033
23034
.....
23054
23055
23056
23057
23058
23059
23060
23061
23062
23063
23064
23065
23066
23067
23068
.....
23106
23107
23108
23109
23110
23111
23112
23113
23114
23115
23116
23117
23118
23119
23120
.....
23122
23123
23124
23125
23126
23127
23128
23129
23130
23131
23132
23133
23134
23135
23136
.....
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
.....
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
.....
23282
23283
23284
23285
23286
23287
23288
23289
23290
23291
23292
23293
23294
23295
23296
.....
23297
23298
23299
23300
23301
23302
23303
23304
23305
23306
23307
23308
23309
23310
23311
.....
23328
23329
23330
23331
23332
23333
23334
23335
23336
23337
23338
23339
23340
23341
23342
query I rowsort
SELECT - cor0.col1 + 92 FROM tab2 AS cor0 GROUP BY cor0.col1
----
31
33
51

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( + 59, - cor0.col0 * + cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col1
----
59

onlyif mysql # DIV for integer division: 
query I rowsort label-159
................................................................................
query I rowsort
SELECT 56 FROM tab2 AS cor0 GROUP BY cor0.col0
----
56
56
56

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( - 79, - cor0.col0 ) FROM tab2 cor0 GROUP BY cor0.col1
----
-79

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - COALESCE ( 55, cor0.col2 ) AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-55
-55
-55

................................................................................
query I rowsort
SELECT ALL - tab1.col1 + - 90 * - 72 FROM tab1 GROUP BY col1
----
6423
6436
6474

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( - 48, cor0.col0 ) AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-48
-48
-48

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( 27, cor0.col0 + - col2 ) * + 32 FROM tab0 AS cor0 GROUP BY col1
----
-864
-864

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + 97, cor0.col2 ) + + cor0.col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
178
97

query I rowsort
................................................................................
query I rowsort
SELECT 30 FROM tab1 AS cor0 GROUP BY cor0.col1
----
30
30
30

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( + 47, - cor0.col0 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
47
47
47

................................................................................
89

query I rowsort
SELECT DISTINCT ( 83 ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1
----
83

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( 60, tab0.col0 ) FROM tab0 GROUP BY tab0.col1
----
60

query I rowsort
SELECT + 72 * 16 FROM tab1 AS cor0 GROUP BY cor0.col2
................................................................................

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( + 81, cor0.col0 ) FROM tab2 AS cor0 GROUP BY cor0.col2
----
81

query I rowsort
SELECT 29 AS col0 FROM tab1 AS cor0 GROUP BY cor0.col0
................................................................................
-5440

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( 6, cor0.col2 ) + - cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-85
-86
-9

................................................................................
query I rowsort
SELECT ALL - NULLIF ( - cor0.col0, cor0.col0 * col1 ) FROM tab1 AS cor0 GROUP BY cor0.col0, col1
----
22
28
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + 15 * COALESCE ( + 58, tab2.col0 ) FROM tab2 GROUP BY tab2.col2
----
870
870
870

................................................................................
query I rowsort label-2039
SELECT DISTINCT + 8 * - tab1.col2 * tab1.col2 - + 39 / 10 FROM tab1 GROUP BY tab1.col2
----
-16203
-40331
-515

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL COALESCE ( + 5, + tab1.col1 ) AS col1 FROM tab1, tab0 AS cor0 GROUP BY cor0.col2
----
5
5
5

................................................................................
query I rowsort label-3085
SELECT cor0.col1 * + CAST( + COALESCE ( + 7, cor0.col2 ) AS SIGNED ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
567

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3085
SELECT cor0.col1 * + CAST ( + COALESCE ( + 7, cor0.col2 ) AS INTEGER ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
567

query I rowsort
SELECT - cor0.col1 + COALESCE ( 3, col0 ) * + col0 AS col0 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col0, col0
----
-16
214
235

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( - 6, cor0.col1, + cor0.col0 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
6

query I rowsort
SELECT ALL 57 * - COALESCE ( cor0.col0, - cor0.col1, NULLIF ( + cor0.col2, + cor0.col0 ) ) AS col0 FROM tab1 AS cor0 GROUP BY cor0.col1, col0, cor0.col2
................................................................................
query I rowsort
SELECT DISTINCT 62 * COALESCE ( - 12 * - col2, - cor0.col1, 84 * + cor0.col1 ) FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
----
43152
58776
64728

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL cor0.col2 * - COALESCE ( - 91, cor0.col1 * cor0.col1, + 73 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
4095
6461
728

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - cor0.col1 * COALESCE ( + 75, cor0.col1, - cor0.col2, col0 ) FROM tab1 AS cor0 GROUP BY cor0.col1
----
-3300
-4275
-450

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - COALESCE ( 25, cor0.col0 ) + 12 FROM tab0 AS cor0 GROUP BY cor0.col2
----
-13
-13
-13

................................................................................
query I rowsort label-3097
SELECT DISTINCT + 43 * cor0.col1 + cor0.col1 * CAST( COALESCE ( 43, - col2 ) AS SIGNED ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
6966

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3097
SELECT DISTINCT + 43 * cor0.col1 + cor0.col1 * CAST ( COALESCE ( 43, - col2 ) AS INTEGER ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
----
0
6966

query I rowsort
SELECT ALL COALESCE ( + 73, + cor0.col2 ) FROM tab0 AS cor0 GROUP BY cor0.col2
----
73
73
73

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + 97, cor0.col0, + cor0.col0 ) * cor0.col1 * 54 FROM tab2 AS cor0 GROUP BY col1, cor0.col2
----
214758
309042
319518

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( 41, + cor0.col1 ) FROM tab1 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor1.col0, cor1.col1
----
-41

query I rowsort
SELECT - COALESCE ( cor0.col1, cor0.col1 ) * cor0.col1 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
................................................................................
onlyif mysql # DIV for integer division: 
query I rowsort label-3104
SELECT DISTINCT - cor0.col0 * COALESCE ( + 24, - cor0.col0 + + cor0.col2 ) DIV cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col0
----
-24

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3104
SELECT DISTINCT - cor0.col0 * COALESCE ( + 24, - cor0.col0 + + cor0.col2 ) / cor0.col0 FROM tab2 AS cor0 GROUP BY cor0.col0, cor0.col0
----
-24

query I rowsort
SELECT + COALESCE ( + 36, cor0.col1 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT + col1 * + cor0.col2 + COALESCE ( cor0.col1 + cor0.col1, 40, + cor0.col2 ) * + 31 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col2
----
0
0
6966

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( NULLIF ( + cor0.col0, - cor0.col0 ) * 43, 52, cor0.col1 + cor0.col2 * cor0.col0 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
3913
3956
645

................................................................................
query I rowsort
SELECT ALL COALESCE ( 75, cor0.col0 + cor0.col0 * - 85 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
75
75
75

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - COALESCE ( 40, cor0.col0, + cor0.col1, cor0.col0 ) + + col2 FROM tab1 AS cor0 GROUP BY col2, cor0.col1
----
-32
31
5

................................................................................
query I rowsort label-3116
SELECT DISTINCT + COALESCE ( 42, cor0.col0 ) DIV + cor0.col2 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
0
1

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3116
SELECT DISTINCT + COALESCE ( 42, cor0.col0 ) / + cor0.col2 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
0
1

query I rowsort
................................................................................
query I rowsort
SELECT ALL col2 * - COALESCE ( 91 * cor0.col1, + cor0.col2, + cor0.col1 * cor0.col1 ) AS col1 FROM tab1 cor0 GROUP BY cor0.col0, col2, cor0.col1
----
-233415
-284284
-4368

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( 80, + cor0.col2, + col0 ) - cor0.col0 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-171
-172
-95

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( 16, cor0.col1 ) AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
16

query I rowsort
SELECT + COALESCE ( 46 + + cor0.col1, NULLIF ( 22, cor0.col1 ), + cor0.col1 ) AS col1 FROM tab1 cor0 GROUP BY cor0.col1, cor0.col1
................................................................................
query I rowsort
SELECT DISTINCT COALESCE ( cor0.col0, + 5 ) + cor0.col1 FROM tab2 cor0 GROUP BY cor0.col1, cor0.col0
----
133
150
76

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( + 64, + col2 ) + + tab0.col0 FROM tab0 GROUP BY tab0.col0
----
107
147
90

................................................................................
query I rowsort
SELECT + COALESCE ( + 12 + cor0.col1, ( 51 ) * cor0.col1 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col1
----
53
71
73

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + COALESCE ( + 12, cor0.col1, cor0.col0, cor0.col0 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
12
12
12

................................................................................
query I rowsort
SELECT ALL COALESCE ( 53, cor0.col2 * + ( 19 ) ) AS col1 FROM tab1 AS cor0 GROUP BY cor0.col2
----
53
53
53

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( + 99, - tab2.col2 ) AS col2 FROM tab2 GROUP BY col0
----
99

onlyif mysql # DIV for integer division: 
query I rowsort label-3138
................................................................................
SELECT COALESCE ( - 83, + cor0.col1 ) DIV - col0 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
1
1
3

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3139
SELECT COALESCE ( - 83, + cor0.col1 ) / - col0 AS col0 FROM tab0 AS cor0 GROUP BY cor0.col0
----
1
1
3

Changes to test/random/groupby/slt_good_2.test.

900
901
902
903
904
905
906

907
908
909
910
911
912
913
....
1431
1432
1433
1434
1435
1436
1437

1438
1439
1440
1441
1442
1443
1444
....
2109
2110
2111
2112
2113
2114
2115

2116
2117
2118
2119
2120
2121
2122
....
3548
3549
3550
3551
3552
3553
3554

3555
3556
3557
3558
3559
3560
3561
....
4456
4457
4458
4459
4460
4461
4462

4463
4464
4465
4466
4467
4468
4469
....
6214
6215
6216
6217
6218
6219
6220

6221
6222
6223
6224
6225
6226
6227
....
6556
6557
6558
6559
6560
6561
6562

6563
6564
6565
6566
6567
6568
6569
....
7084
7085
7086
7087
7088
7089
7090

7091
7092
7093
7094
7095
7096
7097
....
8337
8338
8339
8340
8341
8342
8343

8344
8345
8346
8347
8348
8349
8350
....
8844
8845
8846
8847
8848
8849
8850

8851
8852
8853
8854
8855
8856
8857
.....
10213
10214
10215
10216
10217
10218
10219

10220
10221
10222
10223
10224
10225
10226
.....
10344
10345
10346
10347
10348
10349
10350

10351
10352
10353
10354
10355
10356
10357
.....
10888
10889
10890
10891
10892
10893
10894

10895
10896
10897
10898
10899
10900
10901
.....
15413
15414
15415
15416
15417
15418
15419

15420
15421
15422
15423
15424
15425
15426
.....
15456
15457
15458
15459
15460
15461
15462

15463
15464
15465
15466
15467
15468
15469
.....
15581
15582
15583
15584
15585
15586
15587

15588
15589
15590
15591
15592
15593
15594
.....
16130
16131
16132
16133
16134
16135
16136

16137
16138
16139
16140
16141
16142
16143
.....
16350
16351
16352
16353
16354
16355
16356

16357
16358
16359
16360
16361
16362
16363
.....
17019
17020
17021
17022
17023
17024
17025

17026
17027
17028
17029
17030
17031
17032
.....
17481
17482
17483
17484
17485
17486
17487

17488
17489
17490
17491
17492
17493
17494
.....
18612
18613
18614
18615
18616
18617
18618

18619
18620
18621
18622
18623
18624
18625
.....
22630
22631
22632
22633
22634
22635
22636

22637
22638
22639
22640
22641
22642
22643
.....
24215
24216
24217
24218
24219
24220
24221

24222
24223
24224
24225
24226
24227
24228
.....
24493
24494
24495
24496
24497
24498
24499

24500
24501
24502
24503
24504
24505
24506
.....
24507
24508
24509
24510
24511
24512
24513

24514
24515
24516
24517
24518
24519
24520
.....
24672
24673
24674
24675
24676
24677
24678

24679
24680
24681
24682
24683
24684
24685
.....
25578
25579
25580
25581
25582
25583
25584

25585
25586
25587
25588
25589
25590
25591
.....
27073
27074
27075
27076
27077
27078
27079

27080
27081
27082
27083
27084
27085
27086
.....
27887
27888
27889
27890
27891
27892
27893

27894
27895
27896
27897
27898
27899
27900
.....
28388
28389
28390
28391
28392
28393
28394

28395
28396
28397
28398
28399
28400
28401
.....
30088
30089
30090
30091
30092
30093
30094

30095
30096
30097
30098
30099
30100
30101
.....
30266
30267
30268
30269
30270
30271
30272

30273
30274
30275
30276
30277
30278
30279
.....
30972
30973
30974
30975
30976
30977
30978

30979
30980
30981
30982
30983
30984
30985
.....
33902
33903
33904
33905
33906
33907
33908

33909
33910
33911
33912
33913
33914
33915
.....
34264
34265
34266
34267
34268
34269
34270

34271
34272
34273
34274
34275
34276
34277
.....
34586
34587
34588
34589
34590
34591
34592

34593
34594
34595
34596
34597
34598
34599
.....
38004
38005
38006
38007
38008
38009
38010

38011
38012
38013
38014
38015
38016
38017
.....
38647
38648
38649
38650
38651
38652
38653

38654
38655
38656
38657
38658
38659
38660
.....
39736
39737
39738
39739
39740
39741
39742

39743
39744
39745
39746
39747
39748
39749
.....
40525
40526
40527
40528
40529
40530
40531

40532
40533
40534
40535
40536
40537
40538
.....
45467
45468
45469
45470
45471
45472
45473

45474
45475
45476
45477
45478
45479
45480
.....
46164
46165
46166
46167
46168
46169
46170

46171
46172
46173
46174
46175
46176
46177
.....
48222
48223
48224
48225
48226
48227
48228

48229
48230
48231
48232
48233
48234
48235
.....
48263
48264
48265
48266
48267
48268
48269

48270
48271
48272
48273
48274
48275
48276
.....
48784
48785
48786
48787
48788
48789
48790

48791
48792
48793
48794
48795
48796
48797
.....
51475
51476
51477
51478
51479
51480
51481

51482
51483
51484
51485
51486
51487
51488
.....
52164
52165
52166
52167
52168
52169
52170

52171
52172
52173
52174
52175
52176
52177
.....
53674
53675
53676
53677
53678
53679
53680

53681
53682
53683
53684
53685
53686
53687
.....
54430
54431
54432
54433
54434
54435
54436

54437
54438
54439
54440
54441
54442
54443
.....
55710
55711
55712
55713
55714
55715
55716

55717
55718
55719
55720
55721
55722
55723
.....
56836
56837
56838
56839
56840
56841
56842

56843
56844
56845
56846
56847
56848
56849
.....
57802
57803
57804
57805
57806
57807
57808

57809
57810
57811
57812
57813
57814
57815
.....
58458
58459
58460
58461
58462
58463
58464

58465
58466
58467
58468
58469
58470
58471
.....
59512
59513
59514
59515
59516
59517
59518

59519
59520
59521
59522
59523
59524
59525
.....
60037
60038
60039
60040
60041
60042
60043

60044
60045
60046
60047
60048
60049
60050
.....
62742
62743
62744
62745
62746
62747
62748

62749
62750
62751
62752
62753
62754
62755
.....
63217
63218
63219
63220
63221
63222
63223

63224
63225
63226
63227
63228
63229
63230
.....
63780
63781
63782
63783
63784
63785
63786

63787
63788
63789
63790
63791
63792
63793
.....
64554
64555
64556
64557
64558
64559
64560

64561
64562
64563
64564
64565
64566
64567
.....
64696
64697
64698
64699
64700
64701
64702

64703
64704
64705
64706
64707
64708
64709
.....
64740
64741
64742
64743
64744
64745
64746

64747
64748
64749
64750
64751
64752
64753
.....
65183
65184
65185
65186
65187
65188
65189

65190
65191
65192
65193
65194
65195
65196
.....
65740
65741
65742
65743
65744
65745
65746

65747
65748
65749
65750
65751
65752
65753
.....
69255
69256
69257
69258
69259
69260
69261

69262
69263
69264
69265
69266
69267
69268
.....
69467
69468
69469
69470
69471
69472
69473

69474
69475
69476
69477
69478
69479
69480
.....
69482
69483
69484
69485
69486
69487
69488

69489
69490
69491
69492
69493
69494
69495
.....
69805
69806
69807
69808
69809
69810
69811

69812
69813
69814
69815
69816
69817
69818
.....
69938
69939
69940
69941
69942
69943
69944

69945
69946
69947
69948
69949
69950
69951
.....
70297
70298
70299
70300
70301
70302
70303

70304
70305
70306
70307
70308
70309
70310
.....
70811
70812
70813
70814
70815
70816
70817

70818
70819
70820
70821
70822
70823
70824
.....
71945
71946
71947
71948
71949
71950
71951

71952
71953
71954
71955
71956
71957
71958
.....
72591
72592
72593
72594
72595
72596
72597

72598
72599
72600
72601
72602
72603
72604
query I rowsort
SELECT cor0.col1 + - cor0.col1 * - 2 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
123
177
183


query I rowsort
SELECT COALESCE ( - 17, cor0.col2 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
-17
-17
-17

................................................................................
query I rowsort
SELECT DISTINCT cor0.col2 col2 FROM tab1 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor0.col2
----
45
71
8


query I rowsort
SELECT NULLIF ( + 7, + cor0.col1 * cor0.col1 + + COALESCE ( 95, cor0.col0 * - ( - cor0.col1 * - cor0.col2 ) + col2, - cor0.col1 + cor0.col0 ) * cor0.col1 ) FROM tab2 AS cor0 GROUP BY col0, cor0.col1
----
7
7
7

................................................................................
query I rowsort
SELECT - 68 FROM tab1 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor1.col2
----
-68
-68
-68


query I rowsort
SELECT DISTINCT COALESCE ( 22, cor0.col1 * + col2 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
22

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


query I rowsort
SELECT DISTINCT cor0.col1 * COALESCE ( 26, col1, + ( + 42 ) + cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col1
----
1144
1482
156

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


query I rowsort
SELECT DISTINCT cor0.col1 + COALESCE ( + 39, + cor0.col2 * + cor0.col0 ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
100
80
98

................................................................................
-8

query I rowsort
SELECT DISTINCT - 17 FROM tab0 GROUP BY tab0.col0
----
-17


query I rowsort
SELECT DISTINCT COALESCE ( 51, cor0.col1 ) FROM tab0 AS cor0 GROUP BY col0
----
51

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
................................................................................
SELECT COALESCE ( 30, col1 DIV CAST( 11 AS SIGNED ), cor0.col0 DIV - cor0.col2 + + cor0.col2, cor0.col2 + cor0.col2 DIV col2 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2, col1
----
30
30
30

skipif mysql # not compatible

query I rowsort label-904
SELECT COALESCE ( 30, col1 / CAST ( 11 AS INTEGER ), cor0.col0 / - cor0.col2 + + cor0.col2, cor0.col2 + cor0.col2 / col2 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2, col1
----
30
30
30

................................................................................
query I rowsort
SELECT ALL - cor0.col0 * 32 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-1376
-2656
-832


query I rowsort
SELECT ALL - COALESCE ( 60, cor0.col0 ) + cor0.col1 * - cor0.col2 AS col1 FROM tab0 cor0 GROUP BY cor0.col1, cor0.col2
----
-2004
-60
-60

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


query I rowsort
SELECT ALL + - COALESCE ( - 90, tab2.col2 ) FROM tab2 GROUP BY col1
----
90
90
90

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


query I rowsort
SELECT DISTINCT - COALESCE ( - 73, - cor0.col2 * cor0.col0, 69 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
73

query I rowsort
SELECT + 47 FROM tab0 AS cor0 GROUP BY cor0.col0
................................................................................
query I rowsort
SELECT DISTINCT cor0.col1 * 64 FROM tab2 AS cor0 GROUP BY col1
----
2624
3776
3904


query I rowsort
SELECT col1 + - COALESCE ( + 68, - cor0.col0 ) FROM tab0 cor0 GROUP BY cor0.col1
----
-68
13

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


query I rowsort
SELECT COALESCE ( 53, cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col1
----
53
53
53

................................................................................
65

query I rowsort
SELECT DISTINCT - 71 AS col1 FROM tab1 GROUP BY tab1.col2
----
-71


query I rowsort
SELECT + CASE - 80 WHEN tab2.col1 THEN - 83 END col0 FROM tab2 GROUP BY tab2.col1
----
NULL
NULL
NULL

................................................................................

query I rowsort
SELECT DISTINCT - 11 * tab0.col1 AS col2 FROM tab0 GROUP BY tab0.col1
----
-891
0


query I rowsort
SELECT + COALESCE ( 82, - cor0.col2, COALESCE ( - 87, 88 * cor0.col0 + cor0.col1 ), + cor0.col1 + + col2 * + CASE 66 WHEN cor0.col0 * col2 - - 76 THEN NULL WHEN - cor0.col1 * cor0.col0 THEN col0 WHEN cor0.col0 THEN - cor0.col1 END ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
82
82
82

................................................................................
query I rowsort
SELECT ALL + 65 col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
65
65
65


query I rowsort
SELECT COALESCE ( 80, cor0.col0 * - cor0.col0 ) * col1 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col1
----
0
6480

query I rowsort
................................................................................
13

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


query I rowsort
SELECT cor0.col2 * COALESCE ( - 34, + cor0.col0, cor0.col2 ) FROM tab1 AS cor0 GROUP BY col2
----
-1530
-2414
-272

................................................................................
-4473
-504

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


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

onlyif mysql # DIV for integer division: 
query I rowsort label-2237
SELECT ALL + col1 DIV - tab1.col1 FROM tab1 GROUP BY tab1.col1
................................................................................
SELECT cor0.col1 DIV COALESCE ( + 99, - cor0.col1 * NULLIF ( + 77, - cor0.col0 * cor0.col1 + NULLIF ( 69, - cor0.col2 + + 78 ) * cor0.col1 ), cor0.col0 - cor0.col0 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
0
0
0

skipif mysql # not compatible

query I rowsort label-2265
SELECT cor0.col1 / COALESCE ( + 99, - cor0.col1 * NULLIF ( + 77, - cor0.col0 * cor0.col1 + NULLIF ( 69, - cor0.col2 + + 78 ) * cor0.col1 ), cor0.col0 - cor0.col0 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
0
0
0

................................................................................
query I rowsort
SELECT 54 col1 FROM tab1 AS cor0 GROUP BY cor0.col0, col0
----
54
54
54


query I rowsort
SELECT DISTINCT - 29 - + COALESCE ( - 26, - col1 ) AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2, col2
----
-3

query I rowsort
SELECT DISTINCT 23 AS col1 FROM tab2 GROUP BY col2
................................................................................
query I rowsort
SELECT 9 FROM tab0 cor0 GROUP BY cor0.col0, cor0.col2
----
9
9
9


query I rowsort
SELECT DISTINCT - COALESCE ( + 20, cor0.col2 + - 10 * cor0.col0 ) FROM tab1 AS cor0 GROUP BY col0
----
-20

query I rowsort
SELECT cor0.col2 * - cor0.col2 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
................................................................................
skipif mysql # not compatible
query I rowsort label-2576
SELECT DISTINCT cor0.col1 + + cor0.col0 / cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
----
1
82


query I rowsort
SELECT COALESCE ( + 51, cor0.col1, cor0.col0 - cor0.col2 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
51
51
51

................................................................................
SELECT + CAST( - COALESCE ( 99, - col2, - tab2.col1 ) AS SIGNED ) AS col2 FROM tab2 GROUP BY col0
----
-99
-99
-99

skipif mysql # not compatible

query I rowsort label-3139
SELECT + CAST ( - COALESCE ( 99, - col2, - tab2.col1 ) AS INTEGER ) AS col2 FROM tab2 GROUP BY col0
----
-99
-99
-99

................................................................................
SELECT ALL cor0.col2 * + COALESCE ( 25, + cor0.col1 DIV + col2, + 99 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
1975
600
950

skipif mysql # not compatible

query I rowsort label-3359
SELECT ALL cor0.col2 * + COALESCE ( 25, + cor0.col1 / + col2, + 99 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
1975
600
950

................................................................................
SELECT COALESCE ( 26, + cor0.col0 * cor0.col2, cor0.col0 + - cor0.col0 DIV + cor0.col1 ) FROM tab2 AS cor0 GROUP BY col0
----
26
26
26

skipif mysql # not compatible

query I rowsort label-3397
SELECT COALESCE ( 26, + cor0.col0 * cor0.col2, cor0.col0 + - cor0.col0 / + cor0.col1 ) FROM tab2 AS cor0 GROUP BY col0
----
26
26
26

................................................................................
query I rowsort
SELECT + - 39 FROM tab0 GROUP BY tab0.col2
----
-39
-39
-39


query I rowsort
SELECT COALESCE ( 49, cor0.col0 * cor0.col2 - + 33 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
49
49
49

................................................................................
-29

query I rowsort
SELECT DISTINCT 67 FROM tab1 GROUP BY tab1.col1
----
67


query I rowsort
SELECT DISTINCT + COALESCE ( 67, tab1.col0, + ( - 26 ) ) FROM tab1 GROUP BY tab1.col1
----
67

query I rowsort
SELECT - + 99 AS col2 FROM tab2 GROUP BY tab2.col0
................................................................................
query I rowsort
SELECT + 88 * - cor0.col2 AS col1 FROM tab2, tab0 AS cor0 GROUP BY cor0.col2
----
-2112
-3344
-6952


query I rowsort
SELECT DISTINCT COALESCE ( 75, cor0.col2 ) * + col0 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col0
----
1650
2100
6150

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


query I rowsort
SELECT - - COALESCE ( + 42, - col2 ) AS col2 FROM tab2 GROUP BY tab2.col0
----
42
42
42

................................................................................
query I rowsort
SELECT DISTINCT - cor0.col0 * cor0.col0 + 75 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-150
-8206
-8389


query I rowsort
SELECT COALESCE ( 65, cor0.col1 - cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
65
65
65

................................................................................
query I rowsort label-3917
SELECT ALL + 69 / 4 FROM tab1 GROUP BY col0
----
17
17
17


query I rowsort
SELECT ALL COALESCE ( 26, cor0.col2, cor0.col2 ) FROM tab0 AS cor0 GROUP BY col1
----
26
26

skipif postgresql # PostgreSQL requires AS when renaming output columns
................................................................................
query I rowsort
SELECT ALL - cor0.col1 * + 86 + 81 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-3703
-435
-4821


query I rowsort
SELECT - COALESCE ( 40, col1 * - tab2.col2 ) FROM tab2 GROUP BY tab2.col1
----
-40
-40
-40

................................................................................
query I rowsort
SELECT + 97 * cor0.col2 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col0
----
5626
7663
8439


query I rowsort
SELECT ALL COALESCE ( 15, col0 ) AS col2 FROM tab0 cor0 GROUP BY cor0.col1
----
15
15

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


query I rowsort
SELECT DISTINCT + COALESCE ( + 92, cor0.col0 + cor0.col2, cor0.col0 * cor0.col0 + + cor0.col2 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
92

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


query I rowsort
SELECT - COALESCE ( - 95, + cor0.col2, col2 + + cor0.col2 ) FROM tab1 cor0 GROUP BY cor0.col1
----
95
95
95

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


query I rowsort
SELECT ALL - COALESCE ( 18, cor0.col0 ) FROM tab0 AS cor0 GROUP BY cor0.col2
----
-18
-18
-18

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


query I rowsort
SELECT ALL - cor0.col1 * COALESCE ( + 35, cor0.col2 * - cor0.col0 ) FROM tab0, tab0 AS cor0 GROUP BY cor0.col1
----
-2835
0

query I rowsort
................................................................................
query I rowsort
SELECT ALL cor0.col2 + + cor0.col2 * - 91 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col2
----
-4050
-6390
-720


query I rowsort
SELECT ALL - cor0.col2 + + COALESCE ( 22, cor0.col0, - cor0.col1 + cor0.col2 * col2, + cor0.col1 + - 10 ) * + cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
1659
504
798

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


query I rowsort
SELECT + COALESCE ( + 4, + cor0.col1 * 26, col2 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
4
4
4

................................................................................
query I rowsort
SELECT 36 FROM tab2 GROUP BY tab2.col1
----
36
36
36


query I rowsort
SELECT - COALESCE ( - 82, cor0.col1 - cor0.col2 * - CASE + cor0.col1 * + cor0.col1 WHEN cor0.col1 + cor0.col2 THEN cor0.col2 WHEN cor0.col2 * - col2 + - cor0.col1 THEN col0 END ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
82
82
82

................................................................................
onlyif mysql # DIV for integer division: 
query I rowsort label-5569
SELECT DISTINCT COALESCE ( 5, - cor0.col1 DIV + cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
5

skipif mysql # not compatible

query I rowsort label-5569
SELECT DISTINCT COALESCE ( 5, - cor0.col1 / + cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
5

query I rowsort
SELECT DISTINCT - cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
................................................................................
query I rowsort
SELECT ALL + 64 FROM tab1 cor0 GROUP BY cor0.col2
----
64
64
64


query I rowsort
SELECT ALL COALESCE ( 25, - cor0.col0 * cor0.col1, cor0.col2 + - cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col1
----
25
25
25

................................................................................
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 74 + 25 col2 FROM tab0 GROUP BY tab0.col1
----
99
99


query I rowsort
SELECT - COALESCE ( - 52, + col2 ) * tab1.col1 AS col0 FROM tab1 GROUP BY tab1.col1
----
2288
2964
312

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


query I rowsort
SELECT + COALESCE ( + 13, + tab1.col1, tab1.col0 ) FROM tab1 GROUP BY tab1.col1
----
13
13
13

................................................................................

query I rowsort
SELECT - 43 FROM tab0 GROUP BY tab0.col1
----
-43
-43


query I rowsort
SELECT + ( - COALESCE ( + 62, col1 + + cor0.col2, + cor0.col2 ) ) FROM tab0 AS cor0 GROUP BY col0
----
-62
-62
-62

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


query I rowsort
SELECT COALESCE ( COALESCE ( 6, + cor0.col0 ), - cor0.col2 ) * cor0.col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
156
258
498

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


query I rowsort
SELECT DISTINCT COALESCE ( 47, + cor0.col2 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
47

query I rowsort
SELECT + 42 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT ALL + 51 FROM tab1 GROUP BY tab1.col0
----
51
51
51


query I rowsort
SELECT COALESCE ( 0, + cor1.col2 ) AS col1 FROM tab0 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor1.col0
----
0
0
0

................................................................................
query I rowsort
SELECT 38 col2 FROM tab0 GROUP BY tab0.col2
----
38
38
38


query I rowsort
SELECT COALESCE ( 25, 70, + cor0.col1 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
25
25
25

................................................................................
query I rowsort
SELECT - 76 AS col0 FROM tab1 cor0 GROUP BY cor0.col1
----
-76
-76
-76


query I rowsort
SELECT ALL COALESCE ( 23, col1 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
23
23
23

................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7660
SELECT DISTINCT - CASE - COALESCE ( + tab2.col2, tab2.col1, tab2.col0 * + tab2.col1 + + tab2.col0 ) WHEN CAST( NULL AS SIGNED ) THEN - tab2.col2 ELSE NULL END AS col2 FROM tab2 GROUP BY tab2.col1
----
NULL

skipif mysql # not compatible

query I rowsort label-7660
SELECT DISTINCT - CASE - COALESCE ( + tab2.col2, tab2.col1, tab2.col0 * + tab2.col1 + + tab2.col0 ) WHEN CAST ( NULL AS INTEGER ) THEN - tab2.col2 ELSE NULL END AS col2 FROM tab2 GROUP BY tab2.col1
----
NULL

query I rowsort
SELECT DISTINCT 68 FROM tab2 cor0 GROUP BY cor0.col0, cor0.col1
................................................................................
query I rowsort
SELECT ALL + + tab2.col0 * 31 FROM tab2 GROUP BY tab2.col0
----
2821
2852
465


query I rowsort
SELECT DISTINCT + COALESCE ( - ( 22 ), tab0.col2 * ( COALESCE ( tab0.col1, 24 * - tab0.col0, tab0.col0 ) * - tab0.col2 ) ) + tab0.col2 FROM tab0 GROUP BY tab0.col2
----
16
2
57

................................................................................
query I rowsort
SELECT ALL 73 * - ( tab2.col1 ) FROM tab2 GROUP BY tab2.col1
----
-2993
-4307
-4453


query I rowsort
SELECT + + COALESCE ( + 62, col2, 94, - 39 * tab2.col0 ) FROM tab2 GROUP BY tab2.col1
----
62
62
62

................................................................................

skipif mysql # not compatible
query I rowsort label-8026
SELECT DISTINCT - - 55 / - tab2.col2 AS col2 FROM tab2 GROUP BY tab2.col2
----
0


query I rowsort
SELECT cor0.col2 * COALESCE ( - 40, cor0.col1 * - ( cor0.col2 ) ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-2320
-3160
-3480

................................................................................
SELECT + + COALESCE ( - 51, col2 * - col0 ) DIV + 84 AS col0 FROM tab0 GROUP BY tab0.col0
----
0
0
0

skipif mysql # not compatible

query I rowsort label-8176
SELECT + + COALESCE ( - 51, col2 * - col0 ) / + 84 AS col0 FROM tab0 GROUP BY tab0.col0
----
0
0
0

................................................................................
query I rowsort
SELECT ALL - 96 col0 FROM tab2 GROUP BY tab2.col0
----
-96
-96
-96


query I rowsort
SELECT COALESCE ( - 72, - tab2.col1 ) AS col1 FROM tab2 GROUP BY tab2.col0
----
-72
-72
-72

................................................................................
-66

query I rowsort
SELECT DISTINCT 20 AS col0 FROM tab1 cor0 GROUP BY cor0.col0
----
20


query I rowsort
SELECT - COALESCE ( 32, + tab0.col0, - ( tab0.col0 ) * - tab0.col2 ) AS col1 FROM tab0 GROUP BY tab0.col1
----
-32
-32

query I rowsort
................................................................................
query I rowsort
SELECT ALL + 17 FROM tab1 GROUP BY tab1.col2
----
17
17
17


query I rowsort
SELECT ALL - COALESCE ( 6, - tab2.col0 ) FROM tab2 GROUP BY tab2.col2
----
-6
-6
-6

................................................................................

query I rowsort
SELECT + - 78 + - 95 FROM tab0 GROUP BY tab0.col1
----
-173
-173


query I rowsort
SELECT - + COALESCE ( + 27, col1 ) FROM tab0 GROUP BY tab0.col2
----
-27
-27
-27

................................................................................

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


query I rowsort
SELECT DISTINCT - tab1.col1 * COALESCE ( 52, - tab1.col1, + tab1.col2 * + 64 ) FROM tab1 GROUP BY tab1.col1
----
-2288
-2964
-312

................................................................................
SELECT DISTINCT + + COALESCE ( + tab0.col0, 33, + tab0.col2 DIV - tab0.col1 ) * + 7 AS col2 FROM tab0 GROUP BY tab0.col0
----
182
301
581

skipif mysql # not compatible

query I rowsort label-8874
SELECT DISTINCT + + COALESCE ( + tab0.col0, 33, + tab0.col2 / - tab0.col1 ) * + 7 AS col2 FROM tab0 GROUP BY tab0.col0
----
182
301
581

................................................................................
SELECT - COALESCE ( - 76, + col1, + ( 16 ) - - tab2.col0 ) + + CAST( NULL AS DECIMAL ) AS col1 FROM tab2 GROUP BY tab2.col0
----
NULL
NULL
NULL

skipif mysql # not compatible

query I rowsort label-8879
SELECT - COALESCE ( - 76, + col1, + ( 16 ) - - tab2.col0 ) + + CAST ( NULL AS REAL ) AS col1 FROM tab2 GROUP BY tab2.col0
----
NULL
NULL
NULL

................................................................................
query I rowsort
SELECT - - 86 AS col1 FROM tab2 GROUP BY tab2.col1
----
86
86
86


query I rowsort
SELECT DISTINCT COALESCE ( + COALESCE ( 41, tab0.col1 ), - tab0.col1 * + tab0.col0 + tab0.col0 ) AS col2 FROM tab0 GROUP BY tab0.col1
----
41

query I rowsort
SELECT DISTINCT NULLIF ( tab2.col1, - tab2.col1 * tab2.col1 ) FROM tab2 GROUP BY tab2.col1
................................................................................
query I rowsort
SELECT ALL + tab1.col1 * - 38 AS col0 FROM tab1 GROUP BY tab1.col1
----
-1672
-2166
-228


query I rowsort
SELECT ALL + + COALESCE ( - 49, tab0.col2, tab0.col0 ) FROM tab0 GROUP BY tab0.col1
----
-49
-49

query I rowsort
................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9508
SELECT DISTINCT COALESCE ( 61, tab0.col1 ) * + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col0
----
NULL

skipif mysql # not compatible

query I rowsort label-9508
SELECT DISTINCT COALESCE ( 61, tab0.col1 ) * + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col0
----
NULL

query I rowsort
SELECT DISTINCT - - 44 - tab2.col2 * tab2.col2 FROM tab2 GROUP BY tab2.col2
................................................................................
query I rowsort
SELECT DISTINCT 56 * col0 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col0
----
5096
5152
840


query I rowsort
SELECT - COALESCE ( - 85, cor0.col1 ) AS col0 FROM tab2 AS cor0 GROUP BY cor0.col0
----
85
85
85

................................................................................
query I rowsort
SELECT + - 63 col2 FROM tab0 GROUP BY col0
----
-63
-63
-63


query I rowsort
SELECT - COALESCE ( 22, cor0.col0 * ( - cor0.col1 ), + cor0.col1 + + cor0.col2 * cor0.col1 ) * cor0.col2 AS col2 FROM tab1 AS cor0 GROUP BY cor0.col2
----
-1562
-176
-990

................................................................................
SELECT COALESCE ( 36, cor0.col1 + - COALESCE ( + cor0.col0, + cor0.col1 DIV - cor0.col0 ), cor0.col1 DIV col2 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
36
36
36

skipif mysql # not compatible

query I rowsort label-9581
SELECT COALESCE ( 36, cor0.col1 + - COALESCE ( + cor0.col0, + cor0.col1 / - cor0.col0 ), cor0.col1 / col2 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
36
36
36

................................................................................
46

query I rowsort
SELECT DISTINCT 87 FROM tab0 GROUP BY tab0.col1
----
87


query I rowsort
SELECT - COALESCE ( + 14, - tab2.col0 ) FROM tab2, tab0 AS cor0 GROUP BY tab2.col2
----
-14
-14
-14

................................................................................
query I rowsort
SELECT 45 FROM tab0 GROUP BY tab0.col2
----
45
45
45


query I rowsort
SELECT DISTINCT COALESCE ( 83, + cor1.col1 ) FROM tab0 cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor0.col2, cor1.col0, cor1.col2
----
83

query I rowsort
SELECT ALL cor1.col0 * + 82 AS col0 FROM tab2 AS cor0 CROSS JOIN tab1 AS cor1 GROUP BY cor0.col2, cor1.col0, cor0.col0
................................................................................
query I rowsort
SELECT + - 97 AS col0 FROM tab2 GROUP BY tab2.col0
----
-97
-97
-97


query I rowsort
SELECT DISTINCT + - COALESCE ( 73, tab0.col1 ) AS col2 FROM tab0 GROUP BY tab0.col2
----
-73

onlyif mysql # DIV for integer division: 
query I rowsort label-9720
................................................................................
query I rowsort
SELECT - - 74 FROM tab1 GROUP BY tab1.col2
----
74
74
74


query I rowsort
SELECT - COALESCE ( - 80, + tab0.col2 * col2 + tab0.col1 ) AS col2 FROM tab0 GROUP BY tab0.col0
----
80
80
80

................................................................................
query I rowsort
SELECT + - 74 FROM tab1 GROUP BY tab1.col1
----
-74
-74
-74


query I rowsort
SELECT + CASE 16 WHEN + cor0.col2 THEN NULL WHEN 67 THEN + ( + cor0.col1 ) END AS col0 FROM tab2 AS cor0 GROUP BY cor0.col2
----
NULL
NULL
NULL








>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
....
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
....
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
....
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
....
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
....
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
....
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
....
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
....
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
....
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
.....
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
.....
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
.....
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
.....
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
.....
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
.....
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
.....
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
.....
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
.....
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
.....
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
.....
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
.....
22651
22652
22653
22654
22655
22656
22657
22658
22659
22660
22661
22662
22663
22664
22665
.....
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246
24247
24248
24249
24250
24251
.....
24516
24517
24518
24519
24520
24521
24522
24523
24524
24525
24526
24527
24528
24529
24530
.....
24531
24532
24533
24534
24535
24536
24537
24538
24539
24540
24541
24542
24543
24544
24545
.....
24697
24698
24699
24700
24701
24702
24703
24704
24705
24706
24707
24708
24709
24710
24711
.....
25604
25605
25606
25607
25608
25609
25610
25611
25612
25613
25614
25615
25616
25617
25618
.....
27100
27101
27102
27103
27104
27105
27106
27107
27108
27109
27110
27111
27112
27113
27114
.....
27915
27916
27917
27918
27919
27920
27921
27922
27923
27924
27925
27926
27927
27928
27929
.....
28417
28418
28419
28420
28421
28422
28423
28424
28425
28426
28427
28428
28429
28430
28431
.....
30118
30119
30120
30121
30122
30123
30124
30125
30126
30127
30128
30129
30130
30131
30132
.....
30297
30298
30299
30300
30301
30302
30303
30304
30305
30306
30307
30308
30309
30310
30311
.....
31004
31005
31006
31007
31008
31009
31010
31011
31012
31013
31014
31015
31016
31017
31018
.....
33935
33936
33937
33938
33939
33940
33941
33942
33943
33944
33945
33946
33947
33948
33949
.....
34298
34299
34300
34301
34302
34303
34304
34305
34306
34307
34308
34309
34310
34311
34312
.....
34621
34622
34623
34624
34625
34626
34627
34628
34629
34630
34631
34632
34633
34634
34635
.....
38040
38041
38042
38043
38044
38045
38046
38047
38048
38049
38050
38051
38052
38053
38054
.....
38684
38685
38686
38687
38688
38689
38690
38691
38692
38693
38694
38695
38696
38697
38698
.....
39774
39775
39776
39777
39778
39779
39780
39781
39782
39783
39784
39785
39786
39787
39788
.....
40564
40565
40566
40567
40568
40569
40570
40571
40572
40573
40574
40575
40576
40577
40578
.....
45507
45508
45509
45510
45511
45512
45513
45514
45515
45516
45517
45518
45519
45520
45521
.....
46205
46206
46207
46208
46209
46210
46211
46212
46213
46214
46215
46216
46217
46218
46219
.....
48264
48265
48266
48267
48268
48269
48270
48271
48272
48273
48274
48275
48276
48277
48278
.....
48306
48307
48308
48309
48310
48311
48312
48313
48314
48315
48316
48317
48318
48319
48320
.....
48828
48829
48830
48831
48832
48833
48834
48835
48836
48837
48838
48839
48840
48841
48842
.....
51520
51521
51522
51523
51524
51525
51526
51527
51528
51529
51530
51531
51532
51533
51534
.....
52210
52211
52212
52213
52214
52215
52216
52217
52218
52219
52220
52221
52222
52223
52224
.....
53721
53722
53723
53724
53725
53726
53727
53728
53729
53730
53731
53732
53733
53734
53735
.....
54478
54479
54480
54481
54482
54483
54484
54485
54486
54487
54488
54489
54490
54491
54492
.....
55759
55760
55761
55762
55763
55764
55765
55766
55767
55768
55769
55770
55771
55772
55773
.....
56886
56887
56888
56889
56890
56891
56892
56893
56894
56895
56896
56897
56898
56899
56900
.....
57853
57854
57855
57856
57857
57858
57859
57860
57861
57862
57863
57864
57865
57866
57867
.....
58510
58511
58512
58513
58514
58515
58516
58517
58518
58519
58520
58521
58522
58523
58524
.....
59565
59566
59567
59568
59569
59570
59571
59572
59573
59574
59575
59576
59577
59578
59579
.....
60091
60092
60093
60094
60095
60096
60097
60098
60099
60100
60101
60102
60103
60104
60105
.....
62797
62798
62799
62800
62801
62802
62803
62804
62805
62806
62807
62808
62809
62810
62811
.....
63273
63274
63275
63276
63277
63278
63279
63280
63281
63282
63283
63284
63285
63286
63287
.....
63837
63838
63839
63840
63841
63842
63843
63844
63845
63846
63847
63848
63849
63850
63851
.....
64612
64613
64614
64615
64616
64617
64618
64619
64620
64621
64622
64623
64624
64625
64626
.....
64755
64756
64757
64758
64759
64760
64761
64762
64763
64764
64765
64766
64767
64768
64769
.....
64800
64801
64802
64803
64804
64805
64806
64807
64808
64809
64810
64811
64812
64813
64814
.....
65244
65245
65246
65247
65248
65249
65250
65251
65252
65253
65254
65255
65256
65257
65258
.....
65802
65803
65804
65805
65806
65807
65808
65809
65810
65811
65812
65813
65814
65815
65816
.....
69318
69319
69320
69321
69322
69323
69324
69325
69326
69327
69328
69329
69330
69331
69332
.....
69531
69532
69533
69534
69535
69536
69537
69538
69539
69540
69541
69542
69543
69544
69545
.....
69547
69548
69549
69550
69551
69552
69553
69554
69555
69556
69557
69558
69559
69560
69561
.....
69871
69872
69873
69874
69875
69876
69877
69878
69879
69880
69881
69882
69883
69884
69885
.....
70005
70006
70007
70008
70009
70010
70011
70012
70013
70014
70015
70016
70017
70018
70019
.....
70365
70366
70367
70368
70369
70370
70371
70372
70373
70374
70375
70376
70377
70378
70379
.....
70880
70881
70882
70883
70884
70885
70886
70887
70888
70889
70890
70891
70892
70893
70894
.....
72015
72016
72017
72018
72019
72020
72021
72022
72023
72024
72025
72026
72027
72028
72029
.....
72662
72663
72664
72665
72666
72667
72668
72669
72670
72671
72672
72673
72674
72675
72676
query I rowsort
SELECT cor0.col1 + - cor0.col1 * - 2 AS col2 FROM tab2 AS cor0 GROUP BY col1
----
123
177
183

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( - 17, cor0.col2 ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
-17
-17
-17

................................................................................
query I rowsort
SELECT DISTINCT cor0.col2 col2 FROM tab1 AS cor0 CROSS JOIN tab0 AS cor1 GROUP BY cor0.col2
----
45
71
8

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT NULLIF ( + 7, + cor0.col1 * cor0.col1 + + COALESCE ( 95, cor0.col0 * - ( - cor0.col1 * - cor0.col2 ) + col2, - cor0.col1 + cor0.col0 ) * cor0.col1 ) FROM tab2 AS cor0 GROUP BY col0, cor0.col1
----
7
7
7

................................................................................
query I rowsort
SELECT - 68 FROM tab1 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor1.col2
----
-68
-68
-68

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( 22, cor0.col1 * + col2 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
22

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT cor0.col1 * COALESCE ( 26, col1, + ( + 42 ) + cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col1
----
1144
1482
156

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT cor0.col1 + COALESCE ( + 39, + cor0.col2 * + cor0.col0 ) AS col0 FROM tab2 AS cor0 GROUP BY col1
----
100
80
98

................................................................................
-8

query I rowsort
SELECT DISTINCT - 17 FROM tab0 GROUP BY tab0.col0
----
-17

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( 51, cor0.col1 ) FROM tab0 AS cor0 GROUP BY col0
----
51

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
................................................................................
SELECT COALESCE ( 30, col1 DIV CAST( 11 AS SIGNED ), cor0.col0 DIV - cor0.col2 + + cor0.col2, cor0.col2 + cor0.col2 DIV col2 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2, col1
----
30
30
30

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-904
SELECT COALESCE ( 30, col1 / CAST ( 11 AS INTEGER ), cor0.col0 / - cor0.col2 + + cor0.col2, cor0.col2 + cor0.col2 / col2 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2, col1
----
30
30
30

................................................................................
query I rowsort
SELECT ALL - cor0.col0 * 32 FROM tab0 AS cor0 GROUP BY cor0.col0
----
-1376
-2656
-832

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - COALESCE ( 60, cor0.col0 ) + cor0.col1 * - cor0.col2 AS col1 FROM tab0 cor0 GROUP BY cor0.col1, cor0.col2
----
-2004
-60
-60

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + - COALESCE ( - 90, tab2.col2 ) FROM tab2 GROUP BY col1
----
90
90
90

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( - 73, - cor0.col2 * cor0.col0, 69 ) FROM tab1 AS cor0 GROUP BY cor0.col2
----
73

query I rowsort
SELECT + 47 FROM tab0 AS cor0 GROUP BY cor0.col0
................................................................................
query I rowsort
SELECT DISTINCT cor0.col1 * 64 FROM tab2 AS cor0 GROUP BY col1
----
2624
3776
3904

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT col1 + - COALESCE ( + 68, - cor0.col0 ) FROM tab0 cor0 GROUP BY cor0.col1
----
-68
13

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 53, cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col1
----
53
53
53

................................................................................
65

query I rowsort
SELECT DISTINCT - 71 AS col1 FROM tab1 GROUP BY tab1.col2
----
-71

skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + CASE - 80 WHEN tab2.col1 THEN - 83 END col0 FROM tab2 GROUP BY tab2.col1
----
NULL
NULL
NULL

................................................................................

query I rowsort
SELECT DISTINCT - 11 * tab0.col1 AS col2 FROM tab0 GROUP BY tab0.col1
----
-891
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( 82, - cor0.col2, COALESCE ( - 87, 88 * cor0.col0 + cor0.col1 ), + cor0.col1 + + col2 * + CASE 66 WHEN cor0.col0 * col2 - - 76 THEN NULL WHEN - cor0.col1 * cor0.col0 THEN col0 WHEN cor0.col0 THEN - cor0.col1 END ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
82
82
82

................................................................................
query I rowsort
SELECT ALL + 65 col1 FROM tab2 AS cor0 GROUP BY cor0.col0
----
65
65
65

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 80, cor0.col0 * - cor0.col0 ) * col1 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col1
----
0
6480

query I rowsort
................................................................................
13

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT cor0.col2 * COALESCE ( - 34, + cor0.col0, cor0.col2 ) FROM tab1 AS cor0 GROUP BY col2
----
-1530
-2414
-272

................................................................................
-4473
-504

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT cor0.col0 AS col1 FROM tab2 AS cor0 GROUP BY cor0.col0 HAVING NOT ( NOT col1 IS NOT NULL ) AND ( NULL ) IS NOT NULL
----

onlyif mysql # DIV for integer division: 
query I rowsort label-2237
SELECT ALL + col1 DIV - tab1.col1 FROM tab1 GROUP BY tab1.col1
................................................................................
SELECT cor0.col1 DIV COALESCE ( + 99, - cor0.col1 * NULLIF ( + 77, - cor0.col0 * cor0.col1 + NULLIF ( 69, - cor0.col2 + + 78 ) * cor0.col1 ), cor0.col0 - cor0.col0 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
0
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-2265
SELECT cor0.col1 / COALESCE ( + 99, - cor0.col1 * NULLIF ( + 77, - cor0.col0 * cor0.col1 + NULLIF ( 69, - cor0.col2 + + 78 ) * cor0.col1 ), cor0.col0 - cor0.col0 ) AS col2 FROM tab1 AS cor0 GROUP BY cor0.col1
----
0
0
0

................................................................................
query I rowsort
SELECT 54 col1 FROM tab1 AS cor0 GROUP BY cor0.col0, col0
----
54
54
54

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - 29 - + COALESCE ( - 26, - col1 ) AS col0 FROM tab1 AS cor0 GROUP BY cor0.col2, col2
----
-3

query I rowsort
SELECT DISTINCT 23 AS col1 FROM tab2 GROUP BY col2
................................................................................
query I rowsort
SELECT 9 FROM tab0 cor0 GROUP BY cor0.col0, cor0.col2
----
9
9
9

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - COALESCE ( + 20, cor0.col2 + - 10 * cor0.col0 ) FROM tab1 AS cor0 GROUP BY col0
----
-20

query I rowsort
SELECT cor0.col2 * - cor0.col2 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
................................................................................
skipif mysql # not compatible
query I rowsort label-2576
SELECT DISTINCT cor0.col1 + + cor0.col0 / cor0.col0 FROM tab0 AS cor0 GROUP BY cor0.col0, cor0.col1
----
1
82

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( + 51, cor0.col1, cor0.col0 - cor0.col2 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
51
51
51

................................................................................
SELECT + CAST( - COALESCE ( 99, - col2, - tab2.col1 ) AS SIGNED ) AS col2 FROM tab2 GROUP BY col0
----
-99
-99
-99

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3139
SELECT + CAST ( - COALESCE ( 99, - col2, - tab2.col1 ) AS INTEGER ) AS col2 FROM tab2 GROUP BY col0
----
-99
-99
-99

................................................................................
SELECT ALL cor0.col2 * + COALESCE ( 25, + cor0.col1 DIV + col2, + 99 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
1975
600
950

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3359
SELECT ALL cor0.col2 * + COALESCE ( 25, + cor0.col1 / + col2, + 99 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col0
----
1975
600
950

................................................................................
SELECT COALESCE ( 26, + cor0.col0 * cor0.col2, cor0.col0 + - cor0.col0 DIV + cor0.col1 ) FROM tab2 AS cor0 GROUP BY col0
----
26
26
26

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-3397
SELECT COALESCE ( 26, + cor0.col0 * cor0.col2, cor0.col0 + - cor0.col0 / + cor0.col1 ) FROM tab2 AS cor0 GROUP BY col0
----
26
26
26

................................................................................
query I rowsort
SELECT + - 39 FROM tab0 GROUP BY tab0.col2
----
-39
-39
-39

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 49, cor0.col0 * cor0.col2 - + 33 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
49
49
49

................................................................................
-29

query I rowsort
SELECT DISTINCT 67 FROM tab1 GROUP BY tab1.col1
----
67

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( 67, tab1.col0, + ( - 26 ) ) FROM tab1 GROUP BY tab1.col1
----
67

query I rowsort
SELECT - + 99 AS col2 FROM tab2 GROUP BY tab2.col0
................................................................................
query I rowsort
SELECT + 88 * - cor0.col2 AS col1 FROM tab2, tab0 AS cor0 GROUP BY cor0.col2
----
-2112
-3344
-6952

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( 75, cor0.col2 ) * + col0 FROM tab1 AS cor0 GROUP BY cor0.col0, cor0.col0
----
1650
2100
6150

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - - COALESCE ( + 42, - col2 ) AS col2 FROM tab2 GROUP BY tab2.col0
----
42
42
42

................................................................................
query I rowsort
SELECT DISTINCT - cor0.col0 * cor0.col0 + 75 FROM tab2 AS cor0 GROUP BY cor0.col0
----
-150
-8206
-8389

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 65, cor0.col1 - cor0.col1 ) FROM tab0 AS cor0 GROUP BY cor0.col0
----
65
65
65

................................................................................
query I rowsort label-3917
SELECT ALL + 69 / 4 FROM tab1 GROUP BY col0
----
17
17
17

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL COALESCE ( 26, cor0.col2, cor0.col2 ) FROM tab0 AS cor0 GROUP BY col1
----
26
26

skipif postgresql # PostgreSQL requires AS when renaming output columns
................................................................................
query I rowsort
SELECT ALL - cor0.col1 * + 86 + 81 FROM tab1 AS cor0 GROUP BY cor0.col1
----
-3703
-435
-4821

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( 40, col1 * - tab2.col2 ) FROM tab2 GROUP BY tab2.col1
----
-40
-40
-40

................................................................................
query I rowsort
SELECT + 97 * cor0.col2 AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2, cor0.col0
----
5626
7663
8439

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL COALESCE ( 15, col0 ) AS col2 FROM tab0 cor0 GROUP BY cor0.col1
----
15
15

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( + 92, cor0.col0 + cor0.col2, cor0.col0 * cor0.col0 + + cor0.col2 ) AS col1 FROM tab2 AS cor0 GROUP BY cor0.col2
----
92

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( - 95, + cor0.col2, col2 + + cor0.col2 ) FROM tab1 cor0 GROUP BY cor0.col1
----
95
95
95

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - COALESCE ( 18, cor0.col0 ) FROM tab0 AS cor0 GROUP BY cor0.col2
----
-18
-18
-18

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - cor0.col1 * COALESCE ( + 35, cor0.col2 * - cor0.col0 ) FROM tab0, tab0 AS cor0 GROUP BY cor0.col1
----
-2835
0

query I rowsort
................................................................................
query I rowsort
SELECT ALL cor0.col2 + + cor0.col2 * - 91 FROM tab1 AS cor0 GROUP BY cor0.col2, cor0.col2
----
-4050
-6390
-720

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - cor0.col2 + + COALESCE ( 22, cor0.col0, - cor0.col1 + cor0.col2 * col2, + cor0.col1 + - 10 ) * + cor0.col2 FROM tab0 AS cor0 GROUP BY cor0.col2, cor0.col1
----
1659
504
798

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( + 4, + cor0.col1 * 26, col2 ) AS col2 FROM tab0 AS cor0 GROUP BY cor0.col2
----
4
4
4

................................................................................
query I rowsort
SELECT 36 FROM tab2 GROUP BY tab2.col1
----
36
36
36

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( - 82, cor0.col1 - cor0.col2 * - CASE + cor0.col1 * + cor0.col1 WHEN cor0.col1 + cor0.col2 THEN cor0.col2 WHEN cor0.col2 * - col2 + - cor0.col1 THEN col0 END ) FROM tab2 AS cor0 GROUP BY cor0.col0
----
82
82
82

................................................................................
onlyif mysql # DIV for integer division: 
query I rowsort label-5569
SELECT DISTINCT COALESCE ( 5, - cor0.col1 DIV + cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
5

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-5569
SELECT DISTINCT COALESCE ( 5, - cor0.col1 / + cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col0
----
5

query I rowsort
SELECT DISTINCT - cor0.col1 FROM tab2 AS cor0 GROUP BY cor0.col1, cor0.col2
................................................................................
query I rowsort
SELECT ALL + 64 FROM tab1 cor0 GROUP BY cor0.col2
----
64
64
64

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL COALESCE ( 25, - cor0.col0 * cor0.col1, cor0.col2 + - cor0.col0 ) FROM tab1 AS cor0 GROUP BY cor0.col1
----
25
25
25

................................................................................
skipif postgresql # PostgreSQL requires AS when renaming output columns
query I rowsort
SELECT + 74 + 25 col2 FROM tab0 GROUP BY tab0.col1
----
99
99

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( - 52, + col2 ) * tab1.col1 AS col0 FROM tab1 GROUP BY tab1.col1
----
2288
2964
312

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + COALESCE ( + 13, + tab1.col1, tab1.col0 ) FROM tab1 GROUP BY tab1.col1
----
13
13
13

................................................................................

query I rowsort
SELECT - 43 FROM tab0 GROUP BY tab0.col1
----
-43
-43

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + ( - COALESCE ( + 62, col1 + + cor0.col2, + cor0.col2 ) ) FROM tab0 AS cor0 GROUP BY col0
----
-62
-62
-62

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( COALESCE ( 6, + cor0.col0 ), - cor0.col2 ) * cor0.col0 AS col0 FROM tab0 AS cor0 GROUP BY col0
----
156
258
498

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( 47, + cor0.col2 ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col1
----
47

query I rowsort
SELECT + 42 AS col1 FROM tab0 AS cor0 GROUP BY cor0.col1
................................................................................
query I rowsort
SELECT ALL + 51 FROM tab1 GROUP BY tab1.col0
----
51
51
51

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 0, + cor1.col2 ) AS col1 FROM tab0 AS cor0 CROSS JOIN tab2 AS cor1 GROUP BY cor1.col0
----
0
0
0

................................................................................
query I rowsort
SELECT 38 col2 FROM tab0 GROUP BY tab0.col2
----
38
38
38

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( 25, 70, + cor0.col1 ) AS col1 FROM tab0 AS cor0 GROUP BY cor0.col2
----
25
25
25

................................................................................
query I rowsort
SELECT - 76 AS col0 FROM tab1 cor0 GROUP BY cor0.col1
----
-76
-76
-76

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL COALESCE ( 23, col1 ) AS col0 FROM tab0 AS cor0 GROUP BY cor0.col2
----
23
23
23

................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-7660
SELECT DISTINCT - CASE - COALESCE ( + tab2.col2, tab2.col1, tab2.col0 * + tab2.col1 + + tab2.col0 ) WHEN CAST( NULL AS SIGNED ) THEN - tab2.col2 ELSE NULL END AS col2 FROM tab2 GROUP BY tab2.col1
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-7660
SELECT DISTINCT - CASE - COALESCE ( + tab2.col2, tab2.col1, tab2.col0 * + tab2.col1 + + tab2.col0 ) WHEN CAST ( NULL AS INTEGER ) THEN - tab2.col2 ELSE NULL END AS col2 FROM tab2 GROUP BY tab2.col1
----
NULL

query I rowsort
SELECT DISTINCT 68 FROM tab2 cor0 GROUP BY cor0.col0, cor0.col1
................................................................................
query I rowsort
SELECT ALL + + tab2.col0 * 31 FROM tab2 GROUP BY tab2.col0
----
2821
2852
465

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT + COALESCE ( - ( 22 ), tab0.col2 * ( COALESCE ( tab0.col1, 24 * - tab0.col0, tab0.col0 ) * - tab0.col2 ) ) + tab0.col2 FROM tab0 GROUP BY tab0.col2
----
16
2
57

................................................................................
query I rowsort
SELECT ALL 73 * - ( tab2.col1 ) FROM tab2 GROUP BY tab2.col1
----
-2993
-4307
-4453

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT + + COALESCE ( + 62, col2, 94, - 39 * tab2.col0 ) FROM tab2 GROUP BY tab2.col1
----
62
62
62

................................................................................

skipif mysql # not compatible
query I rowsort label-8026
SELECT DISTINCT - - 55 / - tab2.col2 AS col2 FROM tab2 GROUP BY tab2.col2
----
0

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT cor0.col2 * COALESCE ( - 40, cor0.col1 * - ( cor0.col2 ) ) AS col2 FROM tab2 AS cor0 GROUP BY cor0.col2
----
-2320
-3160
-3480

................................................................................
SELECT + + COALESCE ( - 51, col2 * - col0 ) DIV + 84 AS col0 FROM tab0 GROUP BY tab0.col0
----
0
0
0

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8176
SELECT + + COALESCE ( - 51, col2 * - col0 ) / + 84 AS col0 FROM tab0 GROUP BY tab0.col0
----
0
0
0

................................................................................
query I rowsort
SELECT ALL - 96 col0 FROM tab2 GROUP BY tab2.col0
----
-96
-96
-96

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT COALESCE ( - 72, - tab2.col1 ) AS col1 FROM tab2 GROUP BY tab2.col0
----
-72
-72
-72

................................................................................
-66

query I rowsort
SELECT DISTINCT 20 AS col0 FROM tab1 cor0 GROUP BY cor0.col0
----
20

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - COALESCE ( 32, + tab0.col0, - ( tab0.col0 ) * - tab0.col2 ) AS col1 FROM tab0 GROUP BY tab0.col1
----
-32
-32

query I rowsort
................................................................................
query I rowsort
SELECT ALL + 17 FROM tab1 GROUP BY tab1.col2
----
17
17
17

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL - COALESCE ( 6, - tab2.col0 ) FROM tab2 GROUP BY tab2.col2
----
-6
-6
-6

................................................................................

query I rowsort
SELECT + - 78 + - 95 FROM tab0 GROUP BY tab0.col1
----
-173
-173

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT - + COALESCE ( + 27, col1 ) FROM tab0 GROUP BY tab0.col2
----
-27
-27
-27

................................................................................

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

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT - tab1.col1 * COALESCE ( 52, - tab1.col1, + tab1.col2 * + 64 ) FROM tab1 GROUP BY tab1.col1
----
-2288
-2964
-312

................................................................................
SELECT DISTINCT + + COALESCE ( + tab0.col0, 33, + tab0.col2 DIV - tab0.col1 ) * + 7 AS col2 FROM tab0 GROUP BY tab0.col0
----
182
301
581

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8874
SELECT DISTINCT + + COALESCE ( + tab0.col0, 33, + tab0.col2 / - tab0.col1 ) * + 7 AS col2 FROM tab0 GROUP BY tab0.col0
----
182
301
581

................................................................................
SELECT - COALESCE ( - 76, + col1, + ( 16 ) - - tab2.col0 ) + + CAST( NULL AS DECIMAL ) AS col1 FROM tab2 GROUP BY tab2.col0
----
NULL
NULL
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-8879
SELECT - COALESCE ( - 76, + col1, + ( 16 ) - - tab2.col0 ) + + CAST ( NULL AS REAL ) AS col1 FROM tab2 GROUP BY tab2.col0
----
NULL
NULL
NULL

................................................................................
query I rowsort
SELECT - - 86 AS col1 FROM tab2 GROUP BY tab2.col1
----
86
86
86

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT DISTINCT COALESCE ( + COALESCE ( 41, tab0.col1 ), - tab0.col1 * + tab0.col0 + tab0.col0 ) AS col2 FROM tab0 GROUP BY tab0.col1
----
41

query I rowsort
SELECT DISTINCT NULLIF ( tab2.col1, - tab2.col1 * tab2.col1 ) FROM tab2 GROUP BY tab2.col1
................................................................................
query I rowsort
SELECT ALL + tab1.col1 * - 38 AS col0 FROM tab1 GROUP BY tab1.col1
----
-1672
-2166
-228

skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort
SELECT ALL + + COALESCE ( - 49, tab0.col2, tab0.col0 ) FROM tab0 GROUP BY tab0.col1
----
-49
-49

query I rowsort
................................................................................
onlyif mysql # CAST syntax: SIGNED type: 
query I rowsort label-9508
SELECT DISTINCT COALESCE ( 61, tab0.col1 ) * + CAST( NULL AS SIGNED ) FROM tab0 GROUP BY col0
----
NULL

skipif mysql # not compatible
skipif postgresql # PostgreSQL has strict column usage for GROUP BY clauses
query I rowsort label-9508
SELECT DISTINCT COALESCE ( 61, tab0.col1 ) * + CAST ( NULL AS INTEGER ) FROM tab0 GROUP BY col0
----
NULL

query I rowsort
SELECT DISTINCT - - 44 - tab2.col2 * tab2.col2 FROM tab2 GROUP BY tab2.col2
................................................................................
query I rowsort
SELECT DISTINCT 56 * col0 AS col2 FROM tab2 AS