Thanks for the reply! Do you mean like ".. ORDER BY date DESC, name, importance LIMIT 0,20; "?
If so, I get the result ordered first by date, and if two dates are equal then the importance takes in. However, I want to get the result and then sort the result by importance e.g.: result (date, name, impoartance): 20020102, John, 3; 20020101, Smith, 5; 20010101, Sigmund, 1; 20000101, Sigmund, 8; now I want to sort the result by importance (desc) so the final will be: 20000101, Sigmund, 8; 20020101, Smith, 5; 20020102, John, 3; 20010101, Sigmund, 1; Do you have any way of doing it? SED -----Original Message----- From: Andrew Hazen [mailto:[EMAIL PROTECTED]] Sent: 12. apríl 2002 17:44 To: 'SED' Subject: RE: Is there a function to sort the result (after using ORDER BY)? Just add the field to the Order by clause. It will be sorted first by date, and then by importance within each date. -----Original Message----- From: SED [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 1:11 PM To: [EMAIL PROTECTED] Subject: Is there a function to sort the result (after using ORDER BY)? Hi, Not yet found anything to cover this on the online-docs so I'm aiming at you :) I need to sort the result afterwards e.g.: SELECT name, date, importance FROM 'mytable' WHERE date>'myTime' ORDER BY date DESC, name LIMIT 0,20; ...then I need to sort *only* the result by the 'importance', can I do that via MySQL and if so, how? Thanks, SED --------------------------------------------------------------------- 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 --------------------------------------------------------------------- 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