harryh
unread,Sep 29, 2009, 3:20:35 PM9/29/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Lift
Let's say I want 10 random users from a table In SQL I would do this:
SELECT * FROM users ORDER BY random() LIMIT 10;
Is there any way (without resorting to a fully raw SQL query) to do
this with lift-mapper? I though this would work:
Users.findAll(OrderBySql("random()", IHaveValidatedThisSQL("harryh",
"2009-9-29")),
MaxRows(10))
This does not work, however, because when using SELECT DISTINCT you
can't ORDER BY something that you aren't selecting (in PostgreSQL at
least, might be ok in MySQL).
-harryh