在两个不同表的列sqlite3上联接 [英] join on two different table's column sqlite3
本文介绍了在两个不同表的列sqlite3上联接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你有两个表,一个表包含名为
hi have a two table one table contain column named
表A _id,英语,印地语
Table A _id, Eng, Hindi
其他表包含
表B _id,英语,印地语
Table B _id, Eng, Hindi
我想通过将单词与Eng匹配来联接两个表,如果Eng单词不匹配,它将被添加到来自表B的表A中,否则将保留表A的值
i want to join two table by matching word with Eng if Eng word is not match it will be added into Table A which is from Table B otherwise Table A's value will be remain
例如
现在表B
表A
结果将在表A上
推荐答案
FULL JOIN
是一个术语,用于组合来自多个表的行.不适用于您的需求.
FULL JOIN
is a term to combine rows from multiple table. Does not apply to your needs.
您只需要将表b
中所有不在表a
中的条目插入表a
中.
You only need to insert into table a
all entries in table b
which are not in table a
.
INSERT INTO TABLE a(Eng, Hindi) SELECT Eng, Hindi FROM b WHERE eng NOT IN (SELECT eng FROM a);
这篇关于在两个不同表的列sqlite3上联接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文