From datetime 2018-12-12 10:10:10 to get only year-month I would usually do this in MySQL8.0
date_format('2018-12-12 10:10:10', '%Y-%m')
which outputs 2018-12
How can I do this in Presto or Postgres?
I can do it with
concat(cast(year('2018-12-12 10:10:10') as varchar),'-',cast(month('2018-12-12 10:10:10') as varchar)) as year_month
but seems very cumbersome.