Skip to content

TABLESAMPLE

SELECT * FROM employees TABLESAMPLE BERNOULLI(5);
emp_id | name | department
--------+--------+------------
1001 | John | Sales
2002 | Alice | Marketing
3003 | Bob | IT

The TABLESAMPLE keyword uses the Bernoulli method to return 5% of the rows in the ‘employees’ table. The result can vary, as the Bernoulli method employs randomness in row selection.