RE: Select and =MAX()

2001-06-27 Thread R Talbot
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 |

RE: Select and =MAX()

2001-06-27 Thread Jorge del Conde
]; [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

Re: Select and = MAX()

2001-06-26 Thread Sherzod Ruzmetov
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

RE: Select and = MAX()

2001-06-26 Thread Jorge del Conde
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