Sql Server
update tb_User set pass = ‘‘-- 此处pass前不要加 tb_User 别名usr from tb_User usr inner join tb_Address addr on usr.nAddressFK = addr.nAddressID where usr.id=123
MySql
UPDATE mem_world AS mw1 INNER JOIN mem_world AS mw2 ON mw1.parentid = mw2.wid SET mw1.level = mw2.level WHERE mw2.baseid = 107 AND mw2.parentid = 0 AND mw2.size > 1;
一个是先set再关联,另外一个是先关联再set。
时间: 2024-11-04 18:38:11