-
I have a query like this:
How would I turn this into something that orders by random? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Hey @alper, hi there! This is more of a SQL related question. But yeah, you can order the result in random order with
We don't have However, a small PR would be appreciated to introduce the support of |
Beta Was this translation helpful? Give feedback.
-
Hi @alper, I see you added the random function here, thanks. I still don't know how would I use that in |
Beta Was this translation helpful? Give feedback.
Hey @alper, hi there! This is more of a SQL related question. But yeah, you can order the result in random order with
ORDER RAND()
/ORDER RANDOM()
depending on which db you're on.We don't have
RANDOM
function in SeaQuery yet. So, you'd have to go withExpr::cust()
.However, a small PR would be appreciated to introduce the support of
RANDOM
function. Add aRANDOM
variant to https://github.com/SeaQL/sea-query/blob/cb6fd12ecec848cfe90f05ad7f2a27f2db25028c/src/func.rs#L8-L27