Select 一个月的第一天

Select first day of month in presto

我正在尝试 select Presto (Hive Table) 中的日期值的月份的第一天。我试过 TRUNC(date,'MM'),它在 Hive 中有效,但在 Presto 中无效。

使用date_trunc('month', date_value)

presto> select date_trunc('month', DATE '2018-05-24');
   _col0
------------
 2018-05-01
(1 row)