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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With