将 T-SQL 查询转换为 Access 查询
Translate a T-SQL query to an Access query
我有一个 T-SQL 查询需要更改为 Access 查询。我试了很多次都没有成功
UPDATE T1
SET Cap = ((txg*T2.Cap)/100 ),
IPi=(case when t2.TPi=1 then ((txg*T2.IPiTT)/100) else T1.IPi end)
FROM prg T1
JOIN main T2
ON T1.id = T2.id
where T1.Cap=0
在 Access SQL 中使用 IIF
:
UPDATE
T1
SET
Cap = txg * T2.Cap / 100,
IPi = IIF(T2.TPi = 1, txg * T2.IPiTT / 100, T1.IPi)
FROM
prg AS T1
INNER JOIN
main AS T2
ON T1.id = T2.id
WHERE
T1.Cap = 0
我有一个 T-SQL 查询需要更改为 Access 查询。我试了很多次都没有成功
UPDATE T1
SET Cap = ((txg*T2.Cap)/100 ),
IPi=(case when t2.TPi=1 then ((txg*T2.IPiTT)/100) else T1.IPi end)
FROM prg T1
JOIN main T2
ON T1.id = T2.id
where T1.Cap=0
在 Access SQL 中使用 IIF
:
UPDATE
T1
SET
Cap = txg * T2.Cap / 100,
IPi = IIF(T2.TPi = 1, txg * T2.IPiTT / 100, T1.IPi)
FROM
prg AS T1
INNER JOIN
main AS T2
ON T1.id = T2.id
WHERE
T1.Cap = 0