select * from items order by random() limit 5;
my basic requirement is to get random rows from a table, my where clause
will make sure I won't get same rows in repeated execution of above queries.
--
Regards
To clarify, you are not looking for random then yes? as you want to run select * from items order by random() limit 5; and not get repeating values - as if you are using random you will at times get repeating values.
You are wanting to get a gradually restrictive list(excluding those results you have received previously)? So each time you run the query you are guaranteed to get a new list of 5 rows?
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
✖
By continuing to browse this website, you agree to the use of cookies. Go to Privacy Policy.