<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 怎么办

        How to do IF NOT EXISTS in SQLite(SQLite 中的 IF NOT EXISTS 怎么办)
        <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 怎么办的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 中出现错误)
                  How can I import an Excel file into SQL Server?(如何将 Excel 文件导入 SQL Server?)
                  Export table to file with column headers (column names) using the bcp utility and SQL Server 2008(使用 bcp 实用程序和 SQL Server 2008 将表导出到带有列标题(列名称)的文件)
                  Concat field value to string in SQL Server(将字段值连接到 SQL Server 中的字符串)
                  SQL Server Bulk insert of CSV file with inconsistent quotes(SQL Server 批量插入带有不一致引号的 CSV 文件)
                  <tfoot id='T2Igb'></tfoot>
                    <tbody id='T2Igb'></tbody>
                      • <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>