赞
踩
- DECLARE @T1 TABLE(ID INT,A INT)
- DECLARE @T2 TABLE(ID INT,B INT)
-
-
- INSERT @T1
- ( ID, A )
- VALUES ( 1, -- ID - int
- 0 -- A - int
- )
- INSERT @T1
- ( ID, A )
- VALUES ( 2, -- ID - int
- 2 -- A - int
- )
-
- INSERT @T2
- ( ID, B )
- VALUES ( 1, -- ID - int
- 111 -- A - int
- )
-
- UPDATE @T1
- SET A = B
- FROM @T1 A,@T2 B
- WHERE A.ID = B.ID
-
- SELECT * FROM @T1
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。