Round date to 10 minutes interval

后端 未结 7 2042
独厮守ぢ
独厮守ぢ 2021-02-19 07:26

I have a DATE column that I want to round to the next-lower 10 minute interval in a query (see example below).

I managed to do it by truncating the seconds

7条回答
  •  臣服心动
    2021-02-19 08:12

    You could take the returned value as a string and substring the left side up to the last minute digit and replace it with a 0. I wouldn't exactly say thats better unless you provide some kind of metric.

提交回复
热议问题