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

2002-07-16 Thread Keith C. Ivey
On 16 Jul 2002, at 21:39, Robo wrote: 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 :-( I'm not sure what you

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

2002-07-16 Thread Satish Prabhu
Well if you want the latest and greatest iSession irrespective of the user use select max(iSession) from O_Sessions; If it is to be grouped by user, then select user, max(iSession) from O_Sessions group by user; This will give you the max iSession for a user. Regards Satish -Original

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

2002-07-16 Thread Mike
Have you tried something like this, SELECT iSession FROM O_Sessions GROUP BY iUser ORDER BY iSessions DESC; Mike - Original Message - From: Robo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 16, 2002 3:39 PM Subject: ??? Simple sql-question: SELECT iSession FROM