I want to get a random row from my table by id.
ID|Word |Dificult|Category_id| 1 |'Dumb' |'Easy' | 3 | 2 |'Leopard'|'Medium'| 6 |
If my user selects a category and a difficult, I have pick a random word with user parameters, like:
idRaffle := raffle.id; -- raffle.id = An id that postgres will bring me by some raffle function. d := 'Easy'; c := 3; select * from words where id=idRaffle and Dificult=d and Category_id=c raffle.id
I don't know how to get that random row id (
Note that it must follow the user's selection conditions.