Hi. On Mon 2002-11-04 at 11:56:40 +0100, [EMAIL PROTECTED] wrote: > Christer Holmström (at Home) wrote: [...] > > 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? [...] > What do expect with "ORDER BY 2" ?
That is a shortcut for what you explain below. > 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 See http://www.mysql.com/doc/en/SELECT.html (look for "column position") Regards, 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