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

  • <legend id='Ysw13'><style id='Ysw13'><dir id='Ysw13'><q id='Ysw13'></q></dir></style></legend>
  • <tfoot id='Ysw13'></tfoot>

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

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

      1. LAST_INSERT_ID() MySQL

        LAST_INSERT_ID() MySQL(LAST_INSERT_ID() MySQL)
          <tbody id='gkGqZ'></tbody>
              <bdo id='gkGqZ'></bdo><ul id='gkGqZ'></ul>
              <tfoot id='gkGqZ'></tfoot>
              <i id='gkGqZ'><tr id='gkGqZ'><dt id='gkGqZ'><q id='gkGqZ'><span id='gkGqZ'><b id='gkGqZ'><form id='gkGqZ'><ins id='gkGqZ'></ins><ul id='gkGqZ'></ul><sub id='gkGqZ'></sub></form><legend id='gkGqZ'></legend><bdo id='gkGqZ'><pre id='gkGqZ'><center id='gkGqZ'></center></pre></bdo></b><th id='gkGqZ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='gkGqZ'><tfoot id='gkGqZ'></tfoot><dl id='gkGqZ'><fieldset id='gkGqZ'></fieldset></dl></div>

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

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

                  問題描述

                  我有一個 MySQL 問題,我認為它一定很簡單.當我運行以下 MySql 查詢時,我需要從 table1 返回 LAST INSERTED ID:

                  I have a MySQL question that I think must be quite easy. I need to return the LAST INSERTED ID from table1 when I run the following MySql query:

                  INSERT INTO table1 (title,userid) VALUES ('test',1); 
                  INSERT INTO table2 (parentid,otherid,userid) VALUES (LAST_INSERT_ID(),4,1);
                  SELECT LAST_INSERT_ID();
                  

                  如您所知,當前代碼只會返回 table2 的 LAST INSERT ID 而不是 table1,即使我插入 table2 之間,我如何從 table1 獲取 ID?

                  As you can understand the current code will just return the LAST INSERT ID of table2 instead of table1, how can I get the id from table1 even if I insert into table2 between?

                  推薦答案

                  您可以將最后一個插入 id 存儲在一個變量中:

                  You could store the last insert id in a variable :

                  INSERT INTO table1 (title,userid) VALUES ('test', 1); 
                  SET @last_id_in_table1 = LAST_INSERT_ID();
                  INSERT INTO table2 (parentid,otherid,userid) VALUES (@last_id_in_table1, 4, 1);    
                  

                  或者從 table1 中獲取最大 id(警告.請參閱 Rob Starling 評論中的注釋,關于使用最大 id 時競爭條件可能導致的錯誤)

                  Or get the max id from table1 ( Warning. See note in comments from Rob Starling about possible errors from race conditions when using the max id)

                  INSERT INTO table1 (title,userid) VALUES ('test', 1); 
                  INSERT INTO table2 (parentid,otherid,userid) VALUES (LAST_INSERT_ID(), 4, 1); 
                  SELECT MAX(id) FROM table1;  
                  

                  (警告:正如 Rob Starling 在

                  (Warning: as Rob Starling points out in the

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

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

                  相關文檔推薦

                  Dropping MySQL table with SparkSQL(使用 SparkSQL 刪除 MySQL 表)
                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數根據 N 個先前值來決定接下來的 N 個行)
                  Spark SQL/Hive Query Takes Forever With Join(Spark SQL/Hive 查詢永遠需要加入)
                  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屋-程序員軟件開發技
                  No suitable driver found for jdbc in Spark(在 Spark 中找不到適合 jdbc 的驅動程序)
                  <i id='syZSz'><tr id='syZSz'><dt id='syZSz'><q id='syZSz'><span id='syZSz'><b id='syZSz'><form id='syZSz'><ins id='syZSz'></ins><ul id='syZSz'></ul><sub id='syZSz'></sub></form><legend id='syZSz'></legend><bdo id='syZSz'><pre id='syZSz'><center id='syZSz'></center></pre></bdo></b><th id='syZSz'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='syZSz'><tfoot id='syZSz'></tfoot><dl id='syZSz'><fieldset id='syZSz'></fieldset></dl></div>

                      <tfoot id='syZSz'></tfoot>
                            <tbody id='syZSz'></tbody>
                          <legend id='syZSz'><style id='syZSz'><dir id='syZSz'><q id='syZSz'></q></dir></style></legend>
                          • <bdo id='syZSz'></bdo><ul id='syZSz'></ul>

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

                          • 主站蜘蛛池模板: 在线观看成人小视频 | 精品国产欧美一区二区三区成人 | 国产精品日韩欧美一区二区三区 | а_天堂中文最新版地址 | av日韩精品 | 日韩中文字幕第一页 | 日韩一级精品视频在线观看 | 久草网址 | 欧美日韩不卡 | 国产九九九九 | 成人a视频片观看免费 | 成人精品鲁一区一区二区 | 精品国产91乱码一区二区三区 | av片毛片 | 99国内精品久久久久久久 | 国产成人叼嘿视频在线观看 | 精品免费在线 | 曰批视频在线观看 | 国产精品区二区三区日本 | 久久久久国产精品一区二区 | 欧美日高清| 三级免费网 | 丁香婷婷久久久综合精品国产 | 999国产精品视频免费 | 久久久久国产精品 | 91久久综合亚洲鲁鲁五月天 | 81精品国产乱码久久久久久 | 精品一区二区三区在线观看国产 | 一区二区免费高清视频 | 天天操网 | 国产1区 | 久久亚洲春色中文字幕久久久 | 国产一区二区三区日韩 | 久久毛片网站 | 一区二区三区欧美在线观看 | 美女久久久久久久久 | 国产成人精品久久 | 女同久久另类99精品国产 | 亚洲视频不卡 | 殴美黄色录像 | 亚洲国产精品一区二区第一页 |