页首Html代码

返回顶部

update 跨表更新

Mysql跨表更新 多表update sql语句总结

 


################
----------------XXXX 更新head 字段 clubid字段 mysql貌似无法跨表更新update 数据库表
use test_fbfla;
update tb_star
set tb_star.clubid =(select tb_npc_club.clubid from tb_npc_club)
from tb_star,tb_npc_club
where tb_npc_club.uname=tb_star.clubname


use test_fbfla;
update tb_star
set tb_star.clubid = tb_npc_club.clubid
from tb_star,tb_npc_club
where tb_star.clubname = tb_npc_club.uname
###############

 

 

 

好像不工作。。。。

貌似 必须 inner join之类的关联 才可以。。。

http://www.jb51.net/article/32648.htm

http://zhidao.baidu.com/link?url=E-zafce59sSZGIxOyt0VIF4y4JfcV2yF3Yxf-sY_L8ynBizl0rVn8l2JSLfO_VBc0cSwdwAv4kWGLKksqlQ_Tq

http://www.w3school.com.cn/sql/sql_update.asp

 

 

 

 

insert into tableB () 

select XXX

from TableA,tableC

where TableA.XX=tableC.XX

http://jingyan.baidu.com/article/d5c4b52b29c326da570dc548.html

 

posted @ 2013-12-18 17:18  ayanmw  阅读(531)  评论(0编辑  收藏  举报

页脚Html代码