mysql - Using aliases names of columns in where clause -


i have given alis name fields in select clause. not able use these names in clause.

i tried use having clause, takes more time usual clause. there solution ?

you have 2 choices this,

one, use whole expression in where clause,

select hello,         date(curdate()) cur_date   tablename  date(curdate()) >= curdate + interval 1 day 

or two, wrap in subquery

select *        (            select hello,                    date(curdate()) cur_date              tablename        ) subalias  cur_date >= curdate + interval 1 day 

Comments