不知道如何在presto中使用NOW()
函数。似乎应该直截了当,但我没有得到运气
SELECT DISTINCT field
FROM table
WHERE field BETWEEN '2019-01-01' and NOW()
字段 = 瓦尔查尔
应匹配数据类型以避免隐式转换:
SELECT DISTINCT field
FROM table
WHERE CAST(field AS DATE) BETWEEN DATE '2019-01-01' AND CURRENT_DATE;
SELECT DISTINCT field
FROM table
WHERE DATE(field) BETWEEN DATE '2019-01-01' AND CURRENT_DATE;