0

I have given a alis name for all my fields in the select clause. I am not able to use these names in my where clause.

I tried to use having clause, but it takes more time then usual where clause. Is there any solution for this ?

4

1 回答 1

0

你有两个选择,

WHERE一、在子句中使用整个表达式,

SELECT Hello, 
       DATE(CURDATE()) cur_date
FROM   tableName
WHERE  DATE(CURDATE()) >= CURDATE + INTERVAL 1 DAY

或两个,将其包装在子查询中

SELECT *
FROM
       (
           SELECT Hello, 
                  DATE(CURDATE()) cur_date
           FROM   tableName
       ) subAlias
WHERE  cur_date >= CURDATE + INTERVAL 1 DAY
于 2013-05-06T08:18:59.433 回答