PostgreSQL常用日期格式

时间相加减
select date_part('day', '2015-01-15 17:05'::timestamp - '2013-01-14 16:05'::timestamp);
select ('2015-01-15 17:05'::timestamp)::date - ('2015-01-14 19:05'::timestamp)::date;
select count(*) from tablename where adddate>timestamp '2016-11-14 00:00:00' and adddate < timestamp '2016-11-14 23:59:59';

posted @ 2021-01-06 08:54  断魂刀王  阅读(824)  评论(0)    收藏  举报