order by RAND() for mysql #13846
Replies: 3 comments 3 replies
|
Hey @kylderiNascimento 👋, What are you trying to accomplish? Selecting a random row or something else? You can select a random row in Prisma like so: let random = await prisma.user.findMany({
take: 1,
skip: Math.floor(Math.random() * someMaximumNumber)
}) |
|
Why prisma does not allow Is this because of performance (https://jan.kneschke.de/projects/mysql/order-by-rand/) ? |
|
Hi there, To keep our discussions organized and focused on the most relevant topics, we’re reviewing and tidying up our backlog. As part of this process, we’re closing discussions that haven’t had any recent activity and appear to be outdated. If this discussion is still important to you or unresolved, we’d love to hear from you! Feel free to reopen it or start a new one with updated details. For more details about our priorities and vision for the future of Prisma ORM, check out our latest blog post: https://www.prisma.io/blog/prisma-orm-manifesto. Thank you for your understanding and being part of the community! |
Uh oh!
There was an error while loading. Please reload this page.
Hello guys, how do I implement a random orderBy in the query?
I use mySql database.
All reactions