Re: Stochastic Queries

From: Jason Lepack <>
Date: Mon, 10 Sep 2007 05:26:47 -0700
Message-ID: <>

It depends... I don't know of any "good" methods using ANSI SQL, but there are methods that can be used depending on what type of SQL you are using.

Try google... I found all of these solutions by typing into Google: "language-name" random records

In T-SQL there's the newid() method:

Oracle has sample():

MySQL has rand():

Jason Lepack

On Sep 10, 2:21 am, Joe Thurbon <> wrote:
> As a part of some experimental work I've been doing, I need to write
> what I think is best described as a stochastic quota query.
> I would like to write a query like
> where RANDOM is like TOP, except that for successive queries, I get a
> (possibly) different set of 5 COLUMN_FOO values from table TABLE_BAR.
> Has anyone seen such a beast?
> Thanks in advance,
> Joe
Received on Mon Sep 10 2007 - 14:26:47 CEST

Original text of this message