Hi.

On Wed 2002-07-17 at 03:21:34 +0200, [EMAIL PROTECTED] wrote:
> SELECT * FROM O_Sessions AS first, O_Sessions AS second WHERE
> first.iSession=MAX(second.iSession) AND first.iUser=second.iUser
> 
> yes, nice idea, but in mySQL, grouping functions like MAX are only
> allowed in SELECT ... FROM, not in the WERE part :-(

What the above query seems to try to do is explained in the tutorial
section of the manual:

  http://www.mysql.com/doc/e/x/example-Maximum-row.html

and basically boils down to either using a MySQL-ism (the LIMIT in:
... ORDER BY second.iSession DESC LIMIT 1) or using two steps.

Greetings,

        Benjamin.


-- 
[EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to