我正在尝试使用今天的日期cur_date()
并尝试将所有列拉到datestart
列和dateend
列之间。
我已经尝试了以下两个查询,但得到:'where 子句'中的未知列'tdate'
SELECT id,
details,
CURDATE() AS tdate
FROM specials
WHERE tdate BETWEEN datestart AND dateend;
SELECT id,
details,
CURDATE() AS tdate
FROM specials WHERE datestart <= tdate AND dateend >= tdate;