在MSSQL中,我通常使用以下参数:
declare @StartDate as date, @EndDate as date
set @StartDate = '08/01/2015' set @EndDate = '08/15/2015'
----------- and use it here as my Date Range of Records:
Select * from Table_Name
where DateRange between @StartDate and @EndDate
如何在PostgreSQL中执行此操作以生成报告/记录?
答案 0 :(得分:0)
参考官方文件:
http://www.postgresql.org/docs/9.1/interactive/plpgsql-structure.html http://www.postgresql.org/docs/9.1/static/plpgsql-declarations.html
答案 1 :(得分:0)
这样做 在$ BODY $
之后DECLARE startdate date;
DECLARE enddate date;
开始后
startdate ='2015-08-01';
Enddate ='2015-08-15';
retrun query
select * from Table where daterange between startdate and endate