赞
踩
1、简单update
update tablea a set a.id = 0
2、根据一张表更新另一张表 update
update tablea a, tableb b set a.bname=b.name where a.bid=b.id and a.id between 10 and 50
update tablea a inner join tableb b on a.bid=b.id set a.bname=b.name where a.id between 10 and 50
between 是>= and <=,即包含两个边界
eg:
UPDATE mn a,mn_yfp b set a.state ='-10' where a.jxstjrId = b.bh and b.State = '-10' and a.state <>'-1' and a.state <>'-10'
/*mn_yfp主表 mn副表*/
3、update 累加 1
update tablea set CODE_INDEX = CODE_INDEX + 1
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。