久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

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

      MySQL 的“IF EXISTS"的使用

      Usage of MySQL#39;s quot;IF EXISTSquot;(MySQL 的“IF EXISTS的使用)

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

                  <tbody id='ehvPs'></tbody>
              1. <small id='ehvPs'></small><noframes id='ehvPs'>

              2. <legend id='ehvPs'><style id='ehvPs'><dir id='ehvPs'><q id='ehvPs'></q></dir></style></legend>
                本文介紹了MySQL 的“IF EXISTS"的使用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                這里有兩個我想使用但返回錯誤消息的語句:

                Here are two statements that I'd like to work, but which return error messages:

                IF EXISTS (SELECT * FROM gdata_calendars WHERE `group` =  ? AND id = ?) SELECT 1 ELSE SELECT 0
                

                IF ((SELECT COUNT(*) FROM gdata_calendars WHERE `group` =  ? AND id = ?) > 0)  SELECT 1 ELSE SELECT 0;
                

                問號在那里是因為我在 PHP 的 PDO 中使用了參數化的、準備好的語句.但是,我也嘗試過手動使用數據執行此操作,但確實不起作用.

                The question marks are there because I use parametrized, prepared, statements with PHP's PDO. However, I have also tried executing this with data manually, and it really does not work.

                雖然我想知道為什么它們每個都不起作用,但如果可以使其起作用,我更愿意使用第一個查詢.

                While I'd like to know why each of them doesn't work, I would prefer to use the first query if it can be made to work.

                推薦答案

                不能在函數的 OUTSIDE 使用 IF 控制塊.所以這會影響您的兩個查詢.

                You cannot use IF control block OUTSIDE of functions. So that affects both of your queries.

                將 EXISTS 子句轉換為子查詢,而不是在 IF 函數中

                Turn the EXISTS clause into a subquery instead within an IF function

                SELECT IF( EXISTS(
                             SELECT *
                             FROM gdata_calendars
                             WHERE `group` =  ? AND id = ?), 1, 0)
                

                實際上,布爾值返回為 1 或 0

                In fact, booleans are returned as 1 or 0

                SELECT EXISTS(
                         SELECT *
                         FROM gdata_calendars
                         WHERE `group` =  ? AND id = ?)
                

                這篇關于MySQL 的“IF EXISTS"的使用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數根據 N 個先前值來決定接下來的 N 個行)
                reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達式的結果;條款?)
                Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數的 ignore 選項是忽略整個事務還是只是有問題的行?) - IT屋-程序員軟件開發技
                Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時出錯,使用 for 循環數組)
                pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調用 o23.load 時發生錯誤 沒有合適的驅動程序)
                How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數據庫表作為 Spark 數據幀讀取?)
                  <tbody id='udsj7'></tbody>
                • <tfoot id='udsj7'></tfoot>
                  <i id='udsj7'><tr id='udsj7'><dt id='udsj7'><q id='udsj7'><span id='udsj7'><b id='udsj7'><form id='udsj7'><ins id='udsj7'></ins><ul id='udsj7'></ul><sub id='udsj7'></sub></form><legend id='udsj7'></legend><bdo id='udsj7'><pre id='udsj7'><center id='udsj7'></center></pre></bdo></b><th id='udsj7'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='udsj7'><tfoot id='udsj7'></tfoot><dl id='udsj7'><fieldset id='udsj7'></fieldset></dl></div>

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

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

                        • <legend id='udsj7'><style id='udsj7'><dir id='udsj7'><q id='udsj7'></q></dir></style></legend>
                          主站蜘蛛池模板: 亚洲精品aⅴ | 国产一区二区免费 | 99久9| 亚洲毛片在线观看 | 久久久亚洲 | 成人在线观看中文字幕 | 一级毛片视频 | 成人深夜福利 | 精品一区二区三区在线观看 | 日本粉嫩一区二区三区视频 | 成年人国产在线观看 | 亚洲视频www | 狠狠的操 | 精品视频一区二区三区在线观看 | 国产小视频自拍 | 久久久久久久av | 久久久精 | 久久av资源网 | 天天草天天| 中文字幕在线电影观看 | 国产精品久久视频 | 日韩在线欧美 | 91免费视频观看 | 91最新入口 | 国产成人综合av | 91黄色免费看 | 国产综合久久 | 国产精品久久久久久久久久不蜜臀 | 国产日韩欧美另类 | 狠狠夜夜 | 久久天天躁狠狠躁夜夜躁2014 | 中文字幕在线观 | 国产小视频在线 | 精品中文字幕一区二区三区 | 成年人网站免费 | 欧美成人免费 | 欧美一区二区在线 | 日本网站免费在线观看 | 精品一区二区三区四区五区 | 综合色久 | 黄色一级毛片 |