Sqlite3不支持其他数据库中常见的联表更新语法,那么还能曲线救国吗?
一、Sql-Server中联表更新语法
UPDATE table1, table2 SET table1.value=table2.value, a.type=b.type WHERE table1.sid=table2.sid;
二、MySql中联表更新语法
UPDATE t1 SET col1=t2.col1 FROM table1 t1 INNER JOIN table2 t2 ON t1.col2=t2.col2;
三、Sqlite3中联表更新语法
update student
set username = (SELECT user.username FROM user WHERE student.id = user.info_id AND user.type = 3)