我想使用 TABLESAMPLE 从 PostgreSQL 满足特定条件的行中随机采样。
这运行良好:
select * from customers tablesample bernoulli (1);
Run Code Online (Sandbox Code Playgroud)
但我不知道如何将条件嵌入脚本中。例如这个
select * from customers where last_name = 'powell' tablesample bernoulli (1);
Run Code Online (Sandbox Code Playgroud)
抛出这个错误:
SQL 错误 [42601]:错误:“tablesample”位置或附近的语法错误
:71