Jorge
When I issue your suggested commands here are the resulted rows..
mysql SELECT price
-FROM shop
-HAVING price=MAX(price);
Empty set (0.01 sec)
But when I issue...
mysql select price from shop order by price desc;
+---+
| price |
+---+
| 19.95 |
| 10.99 |
| 3.99 |
]; [EMAIL PROTECTED]
Subject: RE: Select and =MAX()
Jorge
When I issue your suggested commands here are the resulted rows..
mysql SELECT price
-FROM shop
-HAVING price=MAX(price);
Empty set (0.01 sec)
But when I issue...
mysql select price from shop order by price desc
Why bother when the following works:
mysql SELECT price FROM shop ORDER BY price DESC LIMIT 1;
On Tue, 26 Jun 2001, R Talbot wrote:
Following the Tutorial
Creating and populating the table Shop in the db Test..
Why won't the following syntax work?
mysql select price
- from
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