-
I wanted to find a similar discussions on this topic, but I could not find any of them. If there are, please post links to them. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hello, you can use the random function from SQL, order by "rand" and then select the first! |
Beta Was this translation helpful? Give feedback.
-
Thanks for answer from @Barbapapazes BUT In my case, worked query.orderByRaw('RANDOM()') RAND(), not worked. |
Beta Was this translation helpful? Give feedback.
-
Since MySQL and Postgres has different implementation, I think it make sense to have a |
Beta Was this translation helpful? Give feedback.
Thanks for answer from @Barbapapazes
Link: #3874 (comment)
BUT
In my case, worked
RAND(), not worked.
RANDOM()
RAND()