我已经知道如何在两个子查询上执行减法/加法,然后将结果设置为新列,通常我一直在复制子查询并将它们放在括号中,如此...
(
(SELECT IIF(BL.value1)
FROM Table1 T1
INNER JOIN Table2 T2 ON T1.ID = T2.Table1ID
Where T2.ID = TableMain.ID
)
- ---<Subtraction here
(SELECT SUM(T5.Value2)
FROM Table4 T4
INNER JOIN Table6 T6 ON T4.ID = T6.Table4ID
INNER JOIN Table7 T7 ON T6.ID = T7.Table6ID
WHERE
T7.FIeld IN (40)
)
) AS [Net Invoice Value]
我想知道的是,通过仅使用别名是否更容易实现此目的?
提前致谢