跟小D每日学口语

在两张表之间使用UPDATE语句

1.

  update   id   set   A=(select   A   from   id,ida   where   id.id=ida.id),B=(select   B   from   id,ida   where   id.id=ida.id),C=(select   C   from   id,ida   where   id.id=ida.id)

 

2. 

  update   id   set   (a,b,c)=(select   a,b,c   from   ida   where   ida.id=id.id);

 

3.

  update   a   set   a.a   =   b.a   ,   a.b   =   b.b   ,   a.c=b.c   from   id   a   ,   ida   b   where   a.id   =   b.id

posted @ 2012-06-28 13:40  Danny Chen  阅读(4255)  评论(0编辑  收藏  举报