> How do I pull a random sample of either 100 records or 5% of the
> population of a table?
SELECT table.* FROM table
ORDER BY random()
LIMIT n;
Yours,
Laurenz Albe
---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your
On Fri, 2007-05-18 at 15:36 -0500, [EMAIL PROTECTED] wrote:
> How do I pull a random sample of either 100 records or 5% of the
> population of a table?
If you can be a little flexible about the number of samples, you can try
select * from table where random()<=0.05;
Of course, there's n
How do I pull a random sample of either 100 records or 5% of the
population of a table?
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster