Re: [GENERAL] Random Sample

2007-05-20 Thread Albe Laurenz
> 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

Re: [GENERAL] Random Sample

2007-05-18 Thread Reece Hart
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

[GENERAL] Random Sample

2007-05-18 Thread tom
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