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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to