|
Such as the title: I want to randomly select a record from a table A, I used two methods, but the results obtained are completely different, please ask prawns:
method one:
select * from tableA where rownum <2 order by dbms_random.random;
Method Two:
select * from (select * from tableA order by dbms_random.random) where rownum <2;
Method one filters out the same record every time
Method two filter out different records each time
Why is the first method not working? According to reason, both methods are random sorting first, and then filtering. Why doesn't the first method work? |
|