I want to use TABLESAMPLE to randomly sample from rows that meet a certain condition with PostgreSQL.
This runs fine:
select * from customers tablesample bernoulli (1);
But I cannot figure out how to embed the condition in the script. This for example
select * from customers where last_name = 'powell' tablesample bernoulli (1);
throws this error:
SQL Error [42601]: ERROR: syntax error at or near "tablesample"
Position: 71