Selecting n number of rows, randomnly from a table
I am having a problem where I have to select "n" number of rows randomnly inside a cursor where n is my percentage
I thought of using sample, which works well if I hard code the number.
insert into run_sample_birthmark sample(v_totaldispositionpct)
select birthmark from(select birthmark from run_depreciation_future
where owner = v_owner and eqp = v_eqp
and sampleindicator is null
But the problem is that I am not able to pass the variable(v_totaldispositionpct) in the sample as my procedure fails.
Any clues ?