;WITH #table  as (
	SELECT t0.F_BTBZ,t0.FNUMBER
	FROM GAT_t_Cust_Entry100057 t0
	WHERE t0.FNUMBER IN ('BT005','BT006','BT012')
)
, #table1 AS (
	SELECT t1.*
	FROM #table t0
		PIVOT (
			SUM(t0.F_BTBZ) FOR
			t0.FNUMBER IN (BT005,BT006,BT012)
		) t1
)
,#table2 AS (
	SELECT *
	FROM GAT_YGCQ t0
		,#table1 t1
	WHERE CONVERT(int,CONVERT(varchar(6) ,t0.F_DATE,112)) = 202503
		AND NOT (t0.FBT005 = t1.BT005
			AND t0.FBT006 = t1.BT006
			AND t0.FBT012 = t1.BT012
		)
)
UPDATE t0 SET t0.FBT005 = t1.BT005
		,t0.FBT006 = t1.BT006
		,t0.FBT012 = t1.BT012
FROM GAT_YGCQ t0
	INNER JOIN #table2 t1 on t1.FID = t0.FID