试图从 Legacy 表中获取每月汇总数据。含义日期列是字符串:
amount date_create
100 2018-01-05
200 2018-02-03
300 2018-01-22
然而,命令
Select DATE_TRUNC(DATE date_create, MONTH) as month,
sum(amount) as amount_m
from table
group by 1
返回以下错误:
错误:语法错误:应为“)”但得到标识符“date_create”
为什么这个查询不运行,可以做些什么来避免这个问题?
谢谢