Hmmm. I have no idea how the distinct could possibly be getting in there since you're not using it as a QueryParam. Is that the exact code you're using for the findAll?
Derek On Tue, Sep 29, 2009 at 1:20 PM, harryh <har...@gmail.com> wrote: > > 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 -~----------~----~----~----~------~----~------~--~---