Hi,
What version of MySQL are you using ?
How is price defined ? .. In the below example, I defined price as
float(9,2).
mysql> SELECT *
-> FROM a;
+-------+
| price |
+-------+
| 19.95 |
| 10.99 |
| 3.99 |
| 3.45 |
| 1.69 |
| 1.45 |
| 1.25 |
+-------+
7 rows in set (0.01 sec)
mysql> SELECT price
-> FROM a
-> HAVING price=MAX(price);
+-------+
| price |
+-------+
| 19.95 |
+-------+
1 row in set (0.01 sec)
mysql>
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: Wednesday, June 27, 2001 8:21 PM
To: [EMAIL PROTECTED]; [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;
+-------+
| price |
+-------+
| 19.95 |
| 10.99 |
| 3.99 |
| 3.45 |
| 1.69 |
| 1.45 |
| 1.25 |
+-------+
7 rows in set (0.01 sec)
Why??
---------------------------------------------------------------------
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