List:General Discussion« Previous MessageNext Message »
From:Faisal Nasim Date:July 30 1999 11:03am
Subject:"as" bug?
View as plain text  
mysql> select concat("cool","kid") as whiz where whiz like "%cool%";
ERROR 1064: parse error near 'where whiz like "%cool%"' at line 1
mysql> select concat("cool","kid") as whiz;
+---------+
| whiz    |
+---------+
| coolkid |
+---------+
1 row in set (0.00 sec)


Why doesn't the first one work? That is just an example as I know
its stupid to give two constants and search for a word in it :)



EXAMPLE #2:

mysql> select *,concat(member,email) as whiz from member;

Works fine! And there is a "whiz" column which has the value of member
and email.

But,

mysql> select *,concat(member,email) as whiz from member where whiz like "%f%";
ERROR 1054: Unknown column 'whiz' in 'where clause'


Why?


But,

mysql> select *,concat(member,email) as whiz from member having whiz like "%f%";

Seems to do the job....

why not "where"?


P.S> Please CC to my mailbox as I am not on the list! :P

Thanx.

Thread
"as" bug?Faisal Nasim30 Jul
  • "as" bug?sinisa30 Jul