我可以像我所做的那样在 t-sql 中使用嵌套的 Case 语句,并且在访问查询中用于乘法的“*”可以在 T-sql 中以相同的方式使用吗?
([Col2]*[col3])
微软访问:
IIf(IsNull([Col1]),([Col2]*[col3]),([col2]*[col3]/[col1])) as Column
T-Sql:
Case When [Col1] Is Null then ([Col2]*[col3])
else ([col2]*[col3]/[col1]) end AS column
女士访问:
IIf(Left([col],1)=3,"Tran",IIf(Left([ss],1)=7,"Con","Sto")) AS [col]
T-sql:
(Case When (Left([col],1)=3) then 'Tran' else (Case When (Left([col],1)=7) then 'Con' else 'Sto' end )end) AS [col type]