Yes, but the problem was in the listbox with auto-sort ;-) /Chris
-----Original Message----- From: Paul DuBois [mailto:paul@;snake.net] Sent: den 5 november 2002 00:20 To: Joseph Bueno; Christer Holmström (at Home) Cc: [EMAIL PROTECTED] Subject: Re: Problems with "ORDER BY" from C API (works from command-line tool mysql.exe) At 11:56 +0100 11/4/02, Joseph Bueno wrote: >Christer Holmström (at Home) wrote: > >> Hi! >> >> This SQL works perfect when running the command line tool mysql.exe >> >> SELECT exe, sum(duration) FROM data GROUP BY exe ORDER BY 2 >> >> BUT when running from the C API, the "ORDER BY" part doesn't seem >> active, why? >> >> Please help. >> >> /Christer >> >> >Hi, > >What do expect with "ORDER BY 2" ? >If you want to arder by "sum(duration)" you should use: >SELECT exe, sum(duration) AS s FROM data GROUP BY exe ORDER BY s How will that be different than "ORDER BY 2", which sorts using the second column? Your alternate query does the same thing. > >Hope this helps >-- >Joseph Bueno --------------------------------------------------------------------- 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