<tfoot id='Xt4w7'></tfoot>
      • <bdo id='Xt4w7'></bdo><ul id='Xt4w7'></ul>

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

      1. <legend id='Xt4w7'><style id='Xt4w7'><dir id='Xt4w7'><q id='Xt4w7'></q></dir></style></legend>

        <i id='Xt4w7'><tr id='Xt4w7'><dt id='Xt4w7'><q id='Xt4w7'><span id='Xt4w7'><b id='Xt4w7'><form id='Xt4w7'><ins id='Xt4w7'></ins><ul id='Xt4w7'></ul><sub id='Xt4w7'></sub></form><legend id='Xt4w7'></legend><bdo id='Xt4w7'><pre id='Xt4w7'><center id='Xt4w7'></center></pre></bdo></b><th id='Xt4w7'></th></span></q></dt></tr></i><div id='Xt4w7'><tfoot id='Xt4w7'></tfoot><dl id='Xt4w7'><fieldset id='Xt4w7'></fieldset></dl></div>

      2. 在 SQLite 上加入表时如何进行更新?

        How do I make an UPDATE while joining tables on SQLite?(在 SQLite 上加入表时如何进行更新?)

              <tbody id='ibyAh'></tbody>

            • <i id='ibyAh'><tr id='ibyAh'><dt id='ibyAh'><q id='ibyAh'><span id='ibyAh'><b id='ibyAh'><form id='ibyAh'><ins id='ibyAh'></ins><ul id='ibyAh'></ul><sub id='ibyAh'></sub></form><legend id='ibyAh'></legend><bdo id='ibyAh'><pre id='ibyAh'><center id='ibyAh'></center></pre></bdo></b><th id='ibyAh'></th></span></q></dt></tr></i><div id='ibyAh'><tfoot id='ibyAh'></tfoot><dl id='ibyAh'><fieldset id='ibyAh'></fieldset></dl></div>

                <bdo id='ibyAh'></bdo><ul id='ibyAh'></ul>
              • <small id='ibyAh'></small><noframes id='ibyAh'>

                  <tfoot id='ibyAh'></tfoot><legend id='ibyAh'><style id='ibyAh'><dir id='ibyAh'><q id='ibyAh'></q></dir></style></legend>
                1. 本文介绍了在 SQLite 上加入表时如何进行更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我试过了:

                  UPDATE closure JOIN item ON ( item_id = id ) 
                  SET checked = 0 
                  WHERE ancestor_id = 1
                  

                  还有:

                  UPDATE closure, item 
                  SET checked = 0 
                  WHERE ancestor_id = 1 AND item_id = id
                  

                  两者都适用于 MySQL,但它们在 SQLite 中给了我一个语法错误.

                  Both works with MySQL, but those give me a syntax error in SQLite.

                  如何使此 UPDATE/JOIN 与 SQLite 3.5.9 版一起使用?

                  How can I make this UPDATE / JOIN works with SQLite version 3.5.9 ?

                  推荐答案

                  你不能.SQLite 不支持 UPDATE 语句中的 JOIN.

                  You can't. SQLite doesn't support JOINs in UPDATE statements.

                  但是,您可以使用子查询来代替:

                  But, you can probably do this with a subquery instead:

                  UPDATE closure SET checked = 0 
                  WHERE item_id IN (SELECT id FROM item WHERE ancestor_id = 1);
                  

                  或者类似的东西;目前尚不清楚您的架构究竟是什么.

                  Or something like that; it's not clear exactly what your schema is.

                  这篇关于在 SQLite 上加入表时如何进行更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  SQLite UPSERT / UPDATE OR INSERT(SQLite UPSERT/更新或插入)
                  Convert SQLITE SQL dump file to POSTGRESQL(将 SQLITE SQL 转储文件转换为 POSTGRESQL)
                  Is there a way to get a list of column names in sqlite?(有没有办法在sqlite中获取列名列表?)
                  How to recover a corrupt SQLite3 database?(如何恢复损坏的 SQLite3 数据库?)
                  Is it possible to access an SQLite database from JavaScript?(是否可以从 JavaScript 访问 SQLite 数据库?)
                  Why use a JOIN clause versus a WHERE condition?(为什么使用 JOIN 子句而不是 WHERE 条件?)

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

                  • <bdo id='bkKch'></bdo><ul id='bkKch'></ul>

                        <tbody id='bkKch'></tbody>
                    • <tfoot id='bkKch'></tfoot>
                          <i id='bkKch'><tr id='bkKch'><dt id='bkKch'><q id='bkKch'><span id='bkKch'><b id='bkKch'><form id='bkKch'><ins id='bkKch'></ins><ul id='bkKch'></ul><sub id='bkKch'></sub></form><legend id='bkKch'></legend><bdo id='bkKch'><pre id='bkKch'><center id='bkKch'></center></pre></bdo></b><th id='bkKch'></th></span></q></dt></tr></i><div id='bkKch'><tfoot id='bkKch'></tfoot><dl id='bkKch'><fieldset id='bkKch'></fieldset></dl></div>

                          <legend id='bkKch'><style id='bkKch'><dir id='bkKch'><q id='bkKch'></q></dir></style></legend>