still not a simple sql-question ! ...

2002-07-17 Thread Robo
new problems, robo :-) - 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 unsub

not so simple sql-question?: ... O_Sessions AS first, O_Sessions AS second ...

2002-07-16 Thread Robo
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 :-( But i will remember this way to work around the G

not so simple sql-question?: SELECT iSession FROM O_Sessions ORDER BY iSession DESC GROUP BY iUser

2002-07-16 Thread Robo
thank's for your replies, but that did not help :-( this is the setting (also look below for example table): O_Sessions contains multilpe recordsets for iUser (let' say iUser=42). I want the last RECORDSET of this iUser=42, not the first. With GROUP BY, all the various recordsets with iUser=42 ar

??? Simple sql-question: SELECT iSession FROM O_Sessions GROUP BY iUser

2002-07-16 Thread Robo
I want the latest (highest) iSession to be selected: SELECT iSession FROM O_Sessions GROUP BY iUser Because of GROUP BY, allways the first(!) recordset for iUser is selected. But i want the last recordset to be selected :-( How can this be done ? (mySQL) (iSession ist the primary key => lat