On Nov 25, 2003, at 11:19 PM, Alexey Loubyansky wrote:


You are misusing GROUP BY here.
What would you like to get in the result?
How does ORDER BY work here?

GROUP BY is intended to be used with statistical functions. To get the result you wrote, I would write the query this way:
SELECT UserId, LocationId, MAX(LastLoginDate) FROM Blah GROUP BY LocationId

Ok I am no SQL king :-) But still ... wouldn't this be useful to have in JBossQL?


S.



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to