【发布时间】:2014-01-05 21:39:04
【问题描述】:
我希望能够使用 C++ 接口比较同一 SQLite 数据库中的两个表以匹配记录。这是我的两张桌子
表名:temptrigrams
ID TEMPTRIGRAM
---------- ----------
1 The cat ran
2 Compare two tables
3 Alex went home
4 Mark sat down
5 this database blows
6 data with a
7 table disco ninja
++78
表名:spamtrigrams
ID TRIGRAM
---------- ----------
1 Sam's nice ham
2 Tuesday was cold
3 Alex stood up
4 Mark passed out
5 this database is
6 date with a
7 disco stew pot
++10000
第一个表有两列和 85 条记录,第二个表有两列和 10007 条记录。
我想获取第一个表并比较 TEMPTRIGRAM 列中的记录,并将其与第二个表中的 TRIGRAM 列进行比较,然后返回表中的匹配数。因此,如果 (ID:1 'The Cat Ran' 出现在 'spamtrigrams' 中,我希望将其计数并在末尾以整数形式返回。
有人能解释一下执行此操作的查询语法吗?
谢谢。
【问题讨论】: