select name, amount from myTable order by amount desc limit 1; destr0 wrote:
> If I hav a table "myTable": > > id name amount > 1 john 2 2 joel 15 > > I want to get the name of the person with the largest amount.. but I > can't seem to come up with a good query for this. > > I tried SELECT name FROM myTable WHERE amount = MAX(amount); > > I get group by errors... > > can anyone suggest a better method for this? > > --------------------------------------------------------------------- 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