case when 写法
select (case when a-b<0 then 0 else a-b end) from table
IIF函数写法
select IIF(a-b<0,0,a-b) from table
是不是很简洁
如果提示 不是可以识别的 内置函数名称,可能是你使用的SQL Server 版本太低了
case when 写法
select (case when a-b<0 then 0 else a-b end) from table
IIF函数写法
select IIF(a-b<0,0,a-b) from table
是不是很简洁
如果提示 不是可以识别的 内置函数名称,可能是你使用的SQL Server 版本太低了