I have a requirement to perform an action against a subset of rows in a DB2 table, i.e. not all rows, but only those that match a WHERE clause. The requirement is to retrieve all of the rows that match the WHERE clause, but in a "random" order. I am thinking I can use a statement like the following
DECLARE RANDOM_CURSOR FOR
SELECT rand() as idx, <and other columns)
WHERE ...
ORDER BY idx
Will this work?
And do I have to SELECT rand(), and if so, what is its datatype?
------------------------------
Curt Gilker
------------------------------