如何使用“where”合并两个sqlite表?条件?

编程入门 行业动态 更新时间:2024-10-26 04:27:40
本文介绍了如何使用“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表?条件?

本文发布于:2023-10-30 12:07:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1542802.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   条件   两个   sqlite

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!