I am not sure if I have understood your problem. Anyway here goes my advice.
If you want to select a random tupla, first of all you need to know how many of them there are. To achieve this write:
select count(*) from table where conditions;
Then get a random number between 1 and the number you got with the previous query. Execute the fetch command inside a loop and stop it when you reach the tupla you got with the random number.
A faster way is to ensure all tuplas got an unique id from 1 to ..., so when you get the random number, you can select the tupla with that id.
Hope this helps.