Sql 如何在列中减去两个临时联合表?
我有四张临时桌: 我要数一数这两张临时表Sql 如何在列中减去两个临时联合表?,sql,tsql,Sql,Tsql,我有四张临时桌: 我要数一数这两张临时表 (#oneyearexpire+#otheryearexpire)作为 (#ONEYRCON+#OTHERYRCON)作为B 然后需要减去A-B 有人能帮我吗 提前感谢:)除了使用 select * from ( select * from #OneyearExpiry union all select * from #OtherYearExpiry ) A except select * from ( select * from #
(#oneyearexpire+#otheryearexpire)作为
(#ONEYRCON+#OTHERYRCON)作为B
然后需要减去A-B
有人能帮我吗
提前感谢:)除了使用
select * from
(
select * from #OneyearExpiry
union all
select * from #OtherYearExpiry
) A
except
select * from
(
select * from #ONEYRCON
union all
select * from #OTHERYRCON
) B
使用子查询?我们无法运行上述操作,并且我们这里没有样本数据或预期结果。非常感谢,它实际上按照我的要求工作。请再次询问如何在三个差异表中为两组联合数据和整个查询数据添加数据。