SQL Athena获取过去12个月的数据

问题描述

我需要获取过去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

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)