有两个表,表一 archives 中有字段 id title type
表二 arctype 中有字段 id type表一archives有数据
id title type 1 有人 55
2 一些 56
3 人类 55
4 鸟类 55
表二arctype有数据
id type 1 55
2 56
3 55
4 55我现在需要将title中含有 人 这个字的,type又为55的 内容 的 type 变为 44那我执行 UPDATE archives SET type=44 WHERE title LIKE '%人%' AND type = 55但这样只能改变一个表,执行结果如下表一archives有数据
id title type 1 有人 44
2 一些 56
3 人类 44
4 鸟类 55
表二arctype有数据
id type 1 55 这里没有变
2 56
3 55 这里没有变 我需要这里也改变
4 55我需要两个表的中数据能同步改变。这条sql语句,怎么写?
表二 arctype 中有字段 id type表一archives有数据
id title type 1 有人 55
2 一些 56
3 人类 55
4 鸟类 55
表二arctype有数据
id type 1 55
2 56
3 55
4 55我现在需要将title中含有 人 这个字的,type又为55的 内容 的 type 变为 44那我执行 UPDATE archives SET type=44 WHERE title LIKE '%人%' AND type = 55但这样只能改变一个表,执行结果如下表一archives有数据
id title type 1 有人 44
2 一些 56
3 人类 44
4 鸟类 55
表二arctype有数据
id type 1 55 这里没有变
2 56
3 55 这里没有变 我需要这里也改变
4 55我需要两个表的中数据能同步改变。这条sql语句,怎么写?
set a.type=44
where b.title LIKE '%人%' AND b.type = 55;UPDATE archives SET type=44 WHERE title LIKE '%人%' AND type = 55;