2019年7月1日 星期一

做過的事,很快就忘..<是該記錄一下!!>.


今天要做一個過濾的動作,將新的暫存 Table (A)  及舊的Table (B) 做一個過濾的動作,取得存在於暫存Table 但不在舊 Table 上的新資料。
找到有人整理清析的說明圖,一目了然!

Select <xxx>
From Table A (從暫存Table A中)
Left Join Table B (加入舊Table B的項目)
on A.key = B.key (設定 A、B Table 相等的是Key )
Where B.key is null (只取 B  Table Key 值是空的,即刪除A、B重疊的項目的意思)





完整參考如下:
https://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins