I have a simple inline view that contains 2 columns.
rn | val
0 | A
... | ...
25 | Z
with d (rn, val) as
select level-1, chr(64+level) from dual connect by level <= 26
select * from d
where rn = floor(dbms_random.value()*25)
>>select floor(dbms_random.value()*25) from dual connect by level <1000
The problem is that the random value is recalculated for each row. So, you might get two random values that match the value -- or go through all the values and never get a hit.
One way to get around this is:
select d.* from (select d.* from d order by dbms_random.value() ) d where rownum = 1;
There are more efficient ways to calculate a random number, but this is intended to be a simple modification to your existing query.
You also might want to ask another question. This question starts with a description of a table that is not used, and then the question is about a query that doesn't use the table. Ask another question, describing the table and the real problem you are having -- along with sample data and desired results.