How to order random () in ORMLite

How to make a request to get random () lines with a limit of 3 lines?

I tried but get an error:

myQueryBuilder.orderBy("random()", true); 
+6
source share
1 answer

I solved this with the orderByRaw(...) method:

 myQueryBuilder.orderByRaw("RANDOM()"); 
+9
source

Source: https://habr.com/ru/post/949316/


All Articles