gpt4 book ai didi

amazon-web-services - 如何在亚马逊 Athena 中调用 date_trunc 函数?

转载 作者:行者123 更新时间:2023-12-04 14:18:25 26 4
gpt4 key购买 nike

我正在尝试选择 date_trunc值(value):

select date_trunc(HOUR, current_date - interval '1' hour);

或者
select date_trunc(HOUR, current_date);

并得到错误:
[42703] ERROR: column "hour" does not exist Позиция: 19

最佳答案

你的问题几乎只是一个错字,但从我可以找到日期/时间单位第一个参数到 date_trunc需要在单引号中:

select date_trunc('HOUR', current_date - interval '1' hour);
OR
select date_trunc('HOUR', current_date);

这个答案可能值得发布为 Presto's own documentation没有给出任何如何使用的实际例子 date_trunc .

关于amazon-web-services - 如何在亚马逊 Athena 中调用 date_trunc 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57907086/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com