From: Eric Savage Date: March 25 1999 3:37pm Subject: Re: Query performance with functions List-Archive: http://lists.mysql.com/mysql/959 Message-Id: <199903251537.KAA32660@mail.hotpop.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > > >>>>> "Curt" == Curt W Zirzow writes: > > Curt> Hello, > Curt> I noticed that in the latest version of mysql that you no longer can > Curt> use the column alias inside the where clause. Does this (ie. In the > Curt> following query) cause the function be called in both cases or would > Curt> it be called once and aliased in the where clause? > > Curt> select function(column) as column_alias > Curt> from table > Curt> where function(column) > 0 > > Hi! > > The above has never worked in any MySQL version and is not even > allowed according to the ANSI SQL standard. > > Regards, > Monty > > PS: You can always use HAVING ... > Perhaps I am not following correctly, but the following query works fine on our system: SELECT DATE_FORMAT(FROM_UNIXTIME(AM_CREATE), '\%W \%M \%D %Y') AS DAY, COUNT(AM_USER) AS TOTAL FROM ACCTMAIN GROUP BY DAY ORDER BY AM_CREATE DESC LIMIT 0,7"); We are running Ver 9.29 Distrib 3.22.17, for pc-linux-gnu (i686) Are you saying that this will not work with 3.22.20? Eric Savage esavage@stripped