I'm trying to select the first day of the month for a date value in Presto (Hive Table). I've tried TRUNC(date,'MM')
which works in Hive but not Presto.
Use date_trunc('month', date_value)
presto> select date_trunc('month', DATE '2018-05-24');
_col0
------------
2018-05-01
(1 row)
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