问题描述
我需要获取过去12个月的数据。我在AWS Athena中使用SQL。下面是我的代码:
CREATE
OR REPLACE VIEW response_view AS
SELECT
"cust"."customer_id","cust"."event_triggered_date"
FROM
(
db.population_view pop
INNER JOIN new_db.manual_response_view cust ON ("pop"."customer_id" = "cust"."customer_id")
)
WHERE "cust"."event_triggered_date" > current_date - interval '12' month
给我一个错误:cannot be applied to varchar,date
event_triggered_filed是一个字符串
这是日期字段的结构:2019-12-04 00:00:00.000