如何使用“where”合并两个sqlite表?条件? [英] How do I merge two sqlite tables using a "where" condition?

查看:105
本文介绍了如何使用“where”合并两个sqlite表?条件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我有两张桌子。其中一个有三列word,count和value。第二个有两列word和value。在第二个表中,value列的每个字段都有一个附加的整数值。在第一个表中,value列为空或带占位符值。



我想将第二个表列value的值导入第一个表格列值通过匹配单词列。



对于单行,命令将类似于



Hello,

I have two tables. One of them has three columns "word", "count", and "value". The second one has two columns "word" and "value". In the second table, every field of the value column has an attached integer value. In the first table, the "value" column is empty or with placeholder values.

I want to import the values of the second table column "value" into the first table column "value" by matching the "word" column.

For a single row, the command would be something like

update table1 set 'value' = "valuefromTable2" where 'word' = "matchingWordFromTable2";





由于我有大约200k行要更新,我宁愿使用潜在的SQLite功能(merge?)而不是一行代码逐行完成工作。你知道怎么做吗?



谢谢!



Since I have around 200k rows to update, I would rather use a potential SQLite feature (merge?)than a piece of code doing the work row by row. Do you know how to achieve that?

Thanks!

推荐答案

这篇关于如何使用“where”合并两个sqlite表?条件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆