Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Building a random function
I am looking for a random function that I can put into a SQL statement. I
know such a function does not exist; I'm interested in the best way to make
it.
I need to run something like the following:
select field1, field2
from table1
order by (field1 - field2) * 100 + random(100)
where random(100) returns a number x where 0 <= x < 100. Since the random() function is being called independently each time, how does a seed get set properly?
Michael Post
CFT Consulting, Inc.
mpost_at_cftconsulting.com
Received on Thu Jul 15 1999 - 14:06:39 CDT
![]() |
![]() |