PostgreSQL 按照日期范围查询

  • method 1

select * from user_info where create_date >= '2019-05-01' and create_date < '2019-08-15';

 

  • method 2

select * from user_info where create_date between '2019-05-01' and '2019-08-15';

 

  • method 3

select * from user_info where create_date >= '2019-05-01'::timestamp and create_date < '2019-08-15'::timestamp;

 

  • method 4

select * from user_info where create_date between to_date('2019-05-01','YYYY-MM-DD') and to_date('2019-08-15','YYYY-MM-DD');

 

posted @ 2019-05-05 20:23  BillyYang  阅读(898)  评论(0编辑  收藏  举报