RE: Select and =MAX()

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

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

Re[2]: Select and = MAX()

2001-06-26 Thread Dvořáček Michal
For best performance i prefer this way (it's faster): SELECT MAX(price) FROM shop; rather than SELECT price FROM shop ORDER BY price DESC LIMIT 1; -- In second case MySQL must select all records from table, sort it and then apply LIMIT (it's must be logicaly slower than first one) Michal D

RE: Select and = MAX()

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

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

Select and = MAX()

2001-06-26 Thread R Talbot
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 : Invalid use of group function Bob T