0
load_date 1と2の間のデルタが見つかった場合は、比較を作成し、マーキングフィールドをインジケータで更新する必要があります。ご意見をお聞かせください!異なるロード日のデータの差をマークするための作成
例データ
ID_person, NM_firstname, load_date, marking_field
120, Appleton, 1
120, Apple, 2
120, George, 1
120, George, 2
クエリは、私が現在持っているが、これは全ての行にマーキングフィールドを更新します。
;with cte as (
select [ID_person],[NM_firstname] from dbo.person where load_date='load1'
except
select [ID_person],[NM_firstname] from dbo.person where load_date='load2'
)
update cte
set Marking_Field='10'
ありがとうございました!