我有一个问题想插入记录的临时表问题试图插入记录的临时表
我有一个临时表#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)
,但它不工作,我看不出有什么问题
有人能帮助我pleaseeee!
在此先感谢
埃利安娜
如果您发布的代码,XML或数据样本,**请**突出显示文本编辑器这些线路并在“代码示例”按钮,单击(编辑器工具栏上的{}}可以很好地格式化和语法突出显示它! –