Hi Andrew, IT is working as it is supposed to , MAX() only returns one row with the highest value. IF you wanna get 100 highest values, just order the rows by id and limit the result set to 100.
SELECT id FROM table WHERE DATE = '20020509' ORDER BY id LIMIT 100 Gurhan -----Original Message----- From: Andrew Kuebler [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 09, 2002 4:31 PM To: [EMAIL PROTECTED] Subject: Pretty Simple MAX Value question... I want to select say 100 of 1,000 records and get the highest value for "id" in that query, however the MAX command always gives me the MAX for the whole table, not just my query. Here's my expression: SELECT MAX(id) FROM table WHERE DATE = '20020509' LIMIT 100 No matter what, I will always get the max for the column for the whole table....adding and removing the "LIMIT" command changes absolutely nothing... Thanks to anyone that might be able to help me... Frustrated, Andrew --------------------------------------------------------------------- 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