select (date_trunc('hour', my_date) + interval date_part('minute', my_date)::int minutes) as group_by_name from table_name where my_date>= '2023-07-12'
having the following exception:
missing ')' at 'date_part'
The interval value needs to be a literal, it cannot be an expression, it won't be evaluated.
You might want to truncate "directly" to minutes, in your example.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.