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 ?
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 ?
你有两个选择,
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