Hi,

I'm not sure this question relates to xwiki, but it seems you could do
something like "order by rand()".

I never tested it

Br,
Jeremie
Le 17 juil. 2014 22:55, "Danilo Oliveira" <[email protected]> a
écrit :

> Hello XWiki Devs,
>
> I have a specific class in the XWiki (TestClass) with more than 50 items.
> However I would like to retrieve, through the HQL statement, just 5 random
>  results.
>
> I know how to set the limit, using the "setlimit", however I don't know and
> I did not find if there is a way to retrieve a random result.
>
> Is it possible, or I will need to make a hql that returns all results and
>  after that take  5 itens randomly?
>
> Thanks
>
> --
> Danilo Amaral de Oliveira
> Engenheiro de Computação
> celular (32) 9111 - 6867
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
>
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to