这一段代码还能简化么?能否像C#那样 ,把条件“or” 用"||"代替, 把下面的代码简化成 1||4||7||10
when ((DATEPART(month, DATEADD (DD,-7,a.LeaseDateFrom))=1) or (DATEPART(month, DATEADD (DD,-7,a.LeaseDateFrom))=4) or (DATEPART(month, DATEADD (DD,-7,a.LeaseDateFrom))=7) or (DATEPART(month,DATEADD (DD,-7,a.LeaseDateFrom))=10)) then
|| 不受sql 语法支持
试试
when DATEPART(month, DATEADD (DD,-7,a.LeaseDateFrom)) in (1,4,7,10)
then