On 02/11/2012 17:59, Dave Thayer wrote:
On Fri, Nov 2, 2012 at 10:49 AM, Alan Bourke <alanpbou...@fastmail.fm> wrote:
Let's say I have a table, and there are a number of candidate records
that I could potentially include in a particular process, then flag them
as processed so they do not get included again.

However, due to constraints I can only take a subset of those candidate
records at a time.

Using a SQL-Select, how would I retrieve a random subset of the records?

How about something like:

SELECT TOP n RAND(), other_columns... FROM your_table ORDER BY 1

to get n samples.

dt
or (?) maybe:

 SELECT TOP n from ( SELECT RAND(), other_columns... FROM your_table ORDER BY 1 
)

  AndyD  8-)#


_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/5094ec94.7040...@hawthorncottage.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to