Hi,

You are using an aggregate function (MAX) in a condition which requires
you to use the HAVING statement instead of the WHERE statement.

Your query should look something like:

SELECT price
FROM shop
HAVING price=MAX(price);


Regards,
Jorge

For technical support contracts, visit https://order.mysql.com/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Jorge del Conde <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Full-Time Developer
/_/  /_/\_, /___/\___\_\___/   Mexico City, Mexico
       <___/   www.mysql.com



-----Original Message-----
From: bobby [mailto:bobby] On Behalf Of R Talbot
Sent: Tuesday, June 26, 2001 7:16 PM
To: [EMAIL PROTECTED]
Subject: Select and = MAX()


Following the Tutorial
Creating and populating the table Shop in the db Test..
Why won't the following syntax work?

mysql> select  price
    -> from shop
    -> where price=Max(price) ;
ERROR 1111: Invalid use of group function

Bob T


---------------------------------------------------------------------
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

Reply via email to