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 want, but the query could be SELECT iUser, MAX(iSession) FROM O_Sessions GROUP BY iUser; If that's not it, you'll need to explain more. -- Keith C. Ivey <[EMAIL PROTECTED]> Tobacco Documents Online http://tobaccodocuments.org --------------------------------------------------------------------- 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