我有一個問題想插入記錄的臨時表問題試圖插入記錄的臨時表
我有一個臨時表#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或數據樣本,**請**突出顯示文本編輯器這些線路並在「代碼示例」按鈕,單擊(編輯器工具欄上的{}}可以很好地格式化和語法突出顯示它! –