[database-devel] Esquleto : 'ORDER BY random()'?

Felipe Almeida Lessa felipe.lessa at gmail.com
Fri Jul 12 14:01:07 CEST 2013


I'm on my phone and didn't test it, but can't you use

    orderBy [asc random_]

? On your SQL the ASC is implicit.

Cheers, =]

--
Felipe.
Enviado do meu Nexus 4.
Em 12/07/2013 03:45, "Erik de Castro Lopo" <mle+hs at mega-nerd.com> escreveu:

> Hi all (and specifically Felipe),
>
> I'm wonder who to implement the following SQL in Esqueleto:
>
>     SELECT * FROM table WHERE field = X ORDER BY RANDOM() LIMIT N
>
> I noticed that there is a random_ function and I figured out how to
> use it by reading the tests, but it doesn't seem to be useful in
> the above context.
>
> Clues? Maybe Esqueleto needs an 'orderByRandom'.
>
> Cheers,
> Erik
> --
> ----------------------------------------------------------------------
> Erik de Castro Lopo
> http://www.mega-nerd.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/database-devel/attachments/20130712/364f70e2/attachment.htm>


More information about the database-devel mailing list