It would be nice if the sample keyword works in subqueries. For instance when you want to insert random data into a table with sql.
Reproducible: Always
Steps to Reproduce:
1.create table foo(val int);
2.create table bar(val int);
3.insert into bar (select * from generate_series(0,100)); --works (of course)
4.insert into foo (select * from bar sample 10); --error
Actual Results:
Step the 4. gives an error:
syntax error, unexpected SAMPLE, expecting UNION or EXCEPT or INTERSECT or ')' in: "insert into foo (select * from foo sample"
Expected Results:
That table foo contains 10 values randomly picked from table bar.
This also doesn't work per commit hash 4c2f4c5c4584 (somewhere on current default)
create view foo_view as (select * from foo limit 1);
CREATE VIEW: LIMIT not supported
(It returns this error whether there are brackets or not.
The text was updated successfully, but these errors were encountered:
Date: 2018-12-14 16:05:38 +0100
From: @aris-koning
To: SQL devs <>
Version: 11.31.11 (Aug2018-SP1)
CC: @njnes
Last updated: 2019-01-17 13:49:03 +0100
Comment 26729
Date: 2018-12-14 16:05:38 +0100
From: @aris-koning
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0
Build Identifier:
It would be nice if the sample keyword works in subqueries. For instance when you want to insert random data into a table with sql.
Reproducible: Always
Steps to Reproduce:
1.create table foo(val int);
2.create table bar(val int);
3.insert into bar (select * from generate_series(0,100)); --works (of course)
4.insert into foo (select * from bar sample 10); --error
Actual Results:
Step the 4. gives an error:
syntax error, unexpected SAMPLE, expecting UNION or EXCEPT or INTERSECT or ')' in: "insert into foo (select * from foo sample"
Expected Results:
That table foo contains 10 values randomly picked from table bar.
Comment 26734
Date: 2018-12-19 11:10:37 +0100
From: @njnes
subqueries with order by, limit and sample work without the brackets.
Comment 26806
Date: 2019-01-17 13:49:03 +0100
From: @aris-koning
This also doesn't work per commit hash 4c2f4c5c4584 (somewhere on current default)
create view foo_view as (select * from foo limit 1);
CREATE VIEW: LIMIT not supported
(It returns this error whether there are brackets or not.
The text was updated successfully, but these errors were encountered: