<bdo id='skWHX'></bdo><ul id='skWHX'></ul>
      1. <small id='skWHX'></small><noframes id='skWHX'>

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

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

        SQLite 中的 IF NOT EXISTS 怎么办

        时间:2023-10-10
        <i id='VDXOH'><tr id='VDXOH'><dt id='VDXOH'><q id='VDXOH'><span id='VDXOH'><b id='VDXOH'><form id='VDXOH'><ins id='VDXOH'></ins><ul id='VDXOH'></ul><sub id='VDXOH'></sub></form><legend id='VDXOH'></legend><bdo id='VDXOH'><pre id='VDXOH'><center id='VDXOH'></center></pre></bdo></b><th id='VDXOH'></th></span></q></dt></tr></i><div id='VDXOH'><tfoot id='VDXOH'></tfoot><dl id='VDXOH'><fieldset id='VDXOH'></fieldset></dl></div>

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

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

                <tbody id='VDXOH'></tbody>
              <tfoot id='VDXOH'></tfoot>

              • <small id='VDXOH'></small><noframes id='VDXOH'>

                • 本文介绍了SQLite 中的 IF NOT EXISTS 怎么办的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试将此行从 MS SQL Server 移植到 SQLite

                  I am trying to port this line from MS SQL Server to SQLite

                  IF NOT EXISTS(SELECT 1 FROM EVENTTYPE WHERE EventTypeName = 'ANI Received') 
                      INSERT INTO EVENTTYPE (EventTypeName) VALUES ('ANI Received');
                  

                  似乎 SQLite 不支持 IF NOT EXISTS 或至少我无法使其工作.我错过了一些简单的东西吗?有解决方法吗?

                  It seems that SQLite does not support IF NOT EXISTS or at least I can't make it work. Am I missing something simple? Is there a workaround?

                  推荐答案

                  这个怎么样?

                  INSERT OR IGNORE INTO EVENTTYPE (EventTypeName) VALUES 'ANI Received'
                  

                  (未经测试,因为我没有 SQLite ......但是这个链接非常具有描述性.)

                  (Untested as I don't have SQLite... however this link is quite descriptive.)

                  此外,这也应该有效:

                  INSERT INTO EVENTTYPE (EventTypeName)
                  SELECT 'ANI Received'
                  WHERE NOT EXISTS (SELECT 1 FROM EVENTTYPE WHERE EventTypeName = 'ANI Received');
                  

                  这篇关于SQLite 中的 IF NOT EXISTS 怎么办的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:HDF5 - 并发、压缩和输入输出性能 下一篇:SQLite 插入速度随着索引数量的增加而变慢

                  相关文章

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

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

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

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