独特好用的PostgreSQL函数
1. date_trunc(text, timestamp)
返回值类型:
timestamp
函数说明:
Truncate to specified precision; see also Section 9.9.2
截取时间子串到指定的时间粒度,如小时、天、月等等
使用示例:
select date_trunc('hour', timestamp '2001-02-16 20:38:40...
原创
2019-12-17 10:21:19 ·
206 阅读 ·
0 评论