List:General Discussion« Previous MessageNext Message »
From:Eric Savage Date:March 25 1999 3:37pm
Subject:Re: Query performance with functions
View as plain text  
> 
> >>>>> "Curt" == Curt W Zirzow <curt@stripped> 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
Thread
Query performance with functionsCurt W. Zirzow25 Mar
  • Query performance with functionsMichael Widenius25 Mar
    • Re: Query performance with functionsEric Savage25 Mar