我在尝试在临时表中插入记录时遇到问题
我有一个临时表#TmpCapacityTable
CapacityDate InstallerCode WorkAreadID FoxtelCodeID value
2/8/12 BAW 7 1510 3
2/8/12 BAW 7 1508 3
第二个临时表#TmpAdjustmentTable
CapacityDate InstallerCode WorkAreadID fFoxtelCodeID value
2/8/12 BAW 7 1510 1
2/8/12 BAW 7 1508 1
2/8/12 BAW 7 1509 1
我需要插入#TmpCapacityTable
那些不在但有的行中#TmpAdjustmentTable
,在示例中只有代码 1509
我正在使用
Insert into #TmpCapacityTable
select * from #TmpAdjustmentTable
where #TmpAdjustmentTable.CapacityDate not in (select #TmpCapacityTable.CapacityDate from #TmpCapacityTable)
and #TmpAdjustmentTable.WorkAreadID not in (select #TmpCapacityTable.WorkAreadID from #TmpCapacityTable)
and #TmpAdjustmentTable.InstallerCode not in (select #TmpCapacityTable.InstallerCode from #TmpCapacityTable)
and #TmpAdjustmentTable.FoxtelCodeID not in (select #TmpCapacityTable.FoxtelCodeID from #TmpCapacityTable)
但它不起作用,我看不出问题出在哪里
有人可以帮我拜托!!!
提前致谢
埃利亚纳