<legend id='41yqh'><style id='41yqh'><dir id='41yqh'><q id='41yqh'></q></dir></style></legend>
      <tfoot id='41yqh'></tfoot>
        <bdo id='41yqh'></bdo><ul id='41yqh'></ul>

    1. <i id='41yqh'><tr id='41yqh'><dt id='41yqh'><q id='41yqh'><span id='41yqh'><b id='41yqh'><form id='41yqh'><ins id='41yqh'></ins><ul id='41yqh'></ul><sub id='41yqh'></sub></form><legend id='41yqh'></legend><bdo id='41yqh'><pre id='41yqh'><center id='41yqh'></center></pre></bdo></b><th id='41yqh'></th></span></q></dt></tr></i><div id='41yqh'><tfoot id='41yqh'></tfoot><dl id='41yqh'><fieldset id='41yqh'></fieldset></dl></div>
      1. <small id='41yqh'></small><noframes id='41yqh'>

        在 SQLite 中合并两个表

        Combine two tables in SQLite(在 SQLite 中合并两个表)
        <i id='JY27u'><tr id='JY27u'><dt id='JY27u'><q id='JY27u'><span id='JY27u'><b id='JY27u'><form id='JY27u'><ins id='JY27u'></ins><ul id='JY27u'></ul><sub id='JY27u'></sub></form><legend id='JY27u'></legend><bdo id='JY27u'><pre id='JY27u'><center id='JY27u'></center></pre></bdo></b><th id='JY27u'></th></span></q></dt></tr></i><div id='JY27u'><tfoot id='JY27u'></tfoot><dl id='JY27u'><fieldset id='JY27u'></fieldset></dl></div>
      2. <legend id='JY27u'><style id='JY27u'><dir id='JY27u'><q id='JY27u'></q></dir></style></legend>
            <tbody id='JY27u'></tbody>

          <tfoot id='JY27u'></tfoot>

                  <bdo id='JY27u'></bdo><ul id='JY27u'></ul>

                  <small id='JY27u'></small><noframes id='JY27u'>

                  本文介绍了在 SQLite 中合并两个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有两个表,ta 和 tb:

                  I have two tables, ta and tb:

                  他:

                  key col1  
                  --------
                  k1 a 
                  k2 c 
                  

                  待定:

                  key col2  
                  -------
                  k2 cc 
                  k3 ee 
                  

                  他们通过钥匙"连接.我想知道我怎样才能得到一张桌子,tc,比如:

                  They connected by "key". I want to know how can I get a table, tc, like:

                  key col1 col2  
                  -------------
                  k1 a  
                  k2 c cc 
                  k3  ee
                  

                  有没有简单的方法而不是插入每条记录?它们是一百万条表记录,所以我需要一种有效的方法.

                  Is there a easy method instead of inserting every record? They are one million records of tables so I need an effective way.

                  推荐答案

                  Make a VIEW两张桌子.编写一个 SELECT ... JOIN 语句,为您提供所需的结果,然后将其用作 VIEW 的基础.

                  Make a VIEW of the two tables. Write a SELECT ... JOIN statement that gives you the result you want, and then use that as the base for a VIEW.

                  示例:

                  CREATE VIEW
                    database.viewname
                  AS
                    SELECT
                      ta.key, 
                      ta.col1,
                      tb.col2
                    FROM
                      ta
                     LEFT JOIN
                      tb
                     USING(key)
                  

                  这篇关于在 SQLite 中合并两个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Building a comma separated list?(建立一个逗号分隔的列表?)
                  Errors in SQL Server while importing CSV file despite varchar(MAX) being used for each column(尽管每列都使用了 varchar(MAX),但在导入 CSV 文件时 SQL Server 中出现错误)
                  Defining a one-to-one relationship in SQL Server(在 SQL Server 中定义一对一关系)
                  SQLite loop statements?(SQLite 循环语句?)
                  Can I use parameters for the table name in sqlite3?(我可以在 sqlite3 中使用表名的参数吗?)
                  SQL - Inserting a row and returning primary key(SQL - 插入一行并返回主键)
                    <bdo id='Edmot'></bdo><ul id='Edmot'></ul>
                      <i id='Edmot'><tr id='Edmot'><dt id='Edmot'><q id='Edmot'><span id='Edmot'><b id='Edmot'><form id='Edmot'><ins id='Edmot'></ins><ul id='Edmot'></ul><sub id='Edmot'></sub></form><legend id='Edmot'></legend><bdo id='Edmot'><pre id='Edmot'><center id='Edmot'></center></pre></bdo></b><th id='Edmot'></th></span></q></dt></tr></i><div id='Edmot'><tfoot id='Edmot'></tfoot><dl id='Edmot'><fieldset id='Edmot'></fieldset></dl></div>

                        <legend id='Edmot'><style id='Edmot'><dir id='Edmot'><q id='Edmot'></q></dir></style></legend>
                      • <small id='Edmot'></small><noframes id='Edmot'>

                          1. <tfoot id='Edmot'></tfoot>
                              <tbody id='Edmot'></tbody>