SQL Server 中如何用一個表的數據更新另一個表中的數據


SQL Server 中如何用一個表的數據更新另一個表中的數據

 

 

for ACCESS 數據庫:

update a, b set a.name=b.name1 where a.id=b.id


 

for SQL Server 數據庫:

"update a set a.name=b.name1 from a,b where a.id=b.id"

 

以下在SQL Server中驗證可行: 

update   a   set   a.status=b.status   
  from   table1   a,table2   b   
  where   a.id1=b.id1  

 

update a inner join b on a.a1=b.b1 set a.a2=b.b2  條件

 

update   table1   set   a.status   =   b.status   
  from   table1   a   inner   join   table2   b     
  on   a.idl   =   b.idl

 

http://topic.csdn.net/t/20041013/14/3451961.html

http://www.cnblogs.com/hanguoji/archive/2007/02/01/636723.aspx

 
 
好文要頂  關注我  收藏該文   
1
0
 
 
 
« 上一篇: RDLC, canGrow=True, canShrink=False, content are shrinked to the left in Safari.
» 下一篇: DataGridView with Paging
posted @  2009-07-24 19:03 emanlee 閱讀(21679) 評論(1) 編輯 收藏

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM