List:General Discussion« Previous MessageNext Message »
From:Faisal Nasim Date:July 30 1999 11:03am
Subject:"where" doesn't work, but "having" works...
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 :)


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.


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



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


"where" doesn't work, but "having" works...Faisal Nasim30 Jul
  • Re: "where" doesn't work, but "having" works...Christian Mack3 Aug