On Mon, May 19, 2008 at 7:24 AM, Jerry Schwartz
> I might not understand what this is doing, but I think it will preferentially sample
> the ids that are at the end of a gap.
What don't you understand about the query or the way I described it?
> You say you want a "flat" distribution; by that I think you mean that the probability
> of selecting any given record is the same. If you have gaps in your data, I can't think of
> any way to do that other than be assigning a unique and sequential ID to each record. If
> you ever delete a record, you'd have to renumber the remaining ones. Then you'd pick off a
> random value for this unique ID.
There are alternatives. (generating a random number for each row for
example, take a look at the original conversation). Having to keep the
sequence holeless would be a pain in the back side, but could be done
with a trigger running something like I describe in the thread ->