类似于:SQL server : update a set a.id =b.id from table_1 a inner join table_2 on a.name=b.name 的写法么 SQL server : update a set a.id =b.id from table_1 a inner join table_2 b on a.name=b.name 改下这个Sql哈,,但是为什么不能在sqlite里执行呢。。求大神指点
绝地无双
浏览 2147回答 1
1回答
元芳怎么了
Update ...From(Cross Join in Update):Sqlite 不支持类似“UPDATE tbl1 SET col2 = tbl2.col2FROM table1 tbl1 INNER JOIN table2 tbl2 ON tbl1.col1 = tbl2.col1”的update,替代的解决办法是:UPDATE table1 SET col2 = (select col2 from table2 where table2.col1=table1.col1 limit 1)where exists(select * from table2 where table2.col1=table1.col1);