Re: RANDOM Question..

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Sat, 12 Sep 1998 08:12:29 +0200
Message-ID: <6td39v$85t$1_at_pascal.a2000.nl>


>I did not see the first reply you are talking about..

Hmmm, I don't like that. I get the impression that my postings are not visible too often. Well, let me repeat my answer on your question on how to sort random:

>RANDOM in the order by..

I just learned this trick some time ago:

    select *
    from emp
    order by dbms_utility.get_hash_value( dump( rowid ), 0, 1000 );

Peter A Fein responded that this, of course, is not really random, not even pseudo random. He is right, as this will always return the rows in the same shuffelled order, although this order is different than the normal order...

Alternatively, get the Rand function at
http://www.oracle.com/st/products/features/free_plsql_utilities.html

    select *
    from emp
    order by Rand;

Arjan. Received on Sat Sep 12 1998 - 08:12:29 CEST

Original text of this message