Re: [SQL] consistent random order

2006-11-30 Thread Jeff Herrin
retschmer <[EMAIL PROTECTED]>, pgsql-sql@postgresql.org Sent: Thursday, November 30, 2006 2:58:23 AM GMT-0500 US/Eastern Subject: Re: [SQL] consistent random order On Wed, Nov 29, 2006 at 12:32:56PM -0500, Jeff Herrin wrote: > I don't think cursors are going to help in this case. T

Re: [SQL] consistent random order

2006-11-30 Thread Shane Ambler
ndom() or maybe update the column a couple of times a day to keep the variety you seem to be after. - Original Message - From: Andreas Kretschmer <[EMAIL PROTECTED]> To: pgsql-sql@postgresql.org Sent: Wednesday, November 29, 2006 12:27:42 PM GMT-0500 US/Eastern Subject: Re: [SQL] c

Re: [SQL] consistent random order

2006-11-29 Thread Michael Fuhr
On Wed, Nov 29, 2006 at 12:32:56PM -0500, Jeff Herrin wrote: > I don't think cursors are going to help in this case. The order > by random() is still going to give different result sets on different > pages. Have you tried using setseed() to seed the random number generator to the same value befor

Re: [SQL] consistent random order

2006-11-29 Thread Jeff Herrin
12:27:42 PM GMT-0500 US/Eastern Subject: Re: [SQL] consistent random order Jeff Herrin <[EMAIL PROTECTED]> schrieb: > I am returning results ordered randomly using 'order by random()'. My issue > has > to do with page numbers in our web application. When I hit the 2nd

Re: [SQL] consistent random order

2006-11-29 Thread Jeff Herrin
I need it a little more random than that. In both these scenarios, the same items will always follow each other. Jeff - Original Message - Why not create a random seed between 1 and the number of possibilities in your web application when a user first hits the site, store that in the

Re: [SQL] consistent random order

2006-11-29 Thread Andreas Kretschmer
Jeff Herrin <[EMAIL PROTECTED]> schrieb: > I am returning results ordered randomly using 'order by random()'. My issue > has > to do with page numbers in our web application. When I hit the 2nd page and > retrieve results with an offset, ordering by random() isn't really what I want > since I wil

Re: [SQL] consistent random order

2006-11-29 Thread Aaron Bono
On 11/29/06, Jeff Herrin <[EMAIL PROTECTED]> wrote: I am returning results ordered randomly using 'order by random()'. My issue has to do with page numbers in our web application. When I hit the 2nd page and retrieve results with an offset, ordering by random() isn't really what I want since I w

[SQL] consistent random order

2006-11-29 Thread Jeff Herrin
I am returning results ordered randomly using 'order by random()'. My issue has to do with page numbers in our web application. When I hit the 2nd page and retrieve results with an offset, ordering by random() isn't really what I want since I will often receive results that were on the 1st pag