数据集日期取参数日期的前一天sql语句怎么写
select * from table1 as a
where a.[日期]=DATEADD(DAY,-1,'${日期}')
或
where
1=1
${if(len(日期)=0,""," and a.[日期]='"+DATEADD(DAY,-1,日期)+"'")}
~~~~~~~~
sql取前一天
select dateadd(d,-1,cast('2021-12-05' as datetime))
select dateadd(d,-1,cast('2021-12-05' as date))