Reputation: 33600
I am trying to select the date_trunc value:
select date_trunc(HOUR, current_date - interval '1' hour);
OR
select date_trunc(HOUR, current_date);
And got error:
[42703] ERROR: column "hour" does not exist Позиция: 19
Upvotes: 11
Views: 30139
Reputation: 521914
Your question borders on just being a typo, but from what I could find the date/time unit first parameter to date_trunc
needs to be in single quotes:
select date_trunc('HOUR', current_date - interval '1' hour);
OR
select date_trunc('HOUR', current_date);
This answer might be worth posting as Presto's own documentation does not give any actual examples of how to use date_trunc
.
Upvotes: 17