赞
踩
1.PG 按年,月,日范围查询示例
//月份范围查询数据 SELECT * FROM "EMS_CHECK_DETAIL" WHERE to_char("CREATE_TIME",'yyyy-mm') BETWEEN '2021-01' and '2021-12' //日期范围查询数据 SELECT * FROM "EMS_CHECK_DETAIL" WHERE to_char("CREATE_TIME",'yyyy-mm-dd') BETWEEN '2021-01-01' and '2022-12-01' //年份范围查询 SELECT * FROM "EMS_CHECK_DETAIL" WHERE to_char("CREATE_TIME",'yyyy') BETWEEN '2021' and '2022'
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。