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

    <legend id='0V3pI'><style id='0V3pI'><dir id='0V3pI'><q id='0V3pI'></q></dir></style></legend>

    <small id='0V3pI'></small><noframes id='0V3pI'>

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

  2. <tfoot id='0V3pI'></tfoot>

    1. Mysql 用同一表中的另一行值更新一行

      Mysql update a row with another row value in same table(Mysql 用同一表中的另一行值更新一行)
        <tbody id='mE0LD'></tbody>

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

            1. <small id='mE0LD'></small><noframes id='mE0LD'>

              <legend id='mE0LD'><style id='mE0LD'><dir id='mE0LD'><q id='mE0LD'></q></dir></style></legend>
              <tfoot id='mE0LD'></tfoot>
                <bdo id='mE0LD'></bdo><ul id='mE0LD'></ul>
              • 本文介紹了Mysql 用同一表中的另一行值更新一行的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我有一張桌子.我想用同一個表中的第 10 行值更新第 5 行.例如:

                I have a table. I want to update the 5th row with 10th row values from the same table. For example:

                SlNo   Name Quali   Exp
                1        x   B.E     2
                2        y   BSC     3
                3        Z   B.A     1.5
                4        A   MSC     2
                5        B   MBA     5
                

                這里我想用第 5 行的值更新第二行.

                Here i want to update second row with the value of 5th row.

                這是我當前的查詢:

                    UPDATE table 
                      SET Name=(select Name from table where slNo='5'),
                               Quali=(select Quali from  table where slNo='5'),
                               Exp=(select Exp from table where slNo='5') 
                      where slNo='3';
                

                這工作正常......但是如果有超過 20 列,以這種方式編寫查詢會變得很費力,因為對于每一列,我必須包含另一個子查詢......還有其他方法可以編寫嗎?查詢以使用同一表中另一行的所有值更新整行?

                this is working fine ... but if there are more than 20 columns it becomes laborious to write a query this way, because for each column I have to include another sub-query... is there any other way to write query to update the whole row with all values from the other row in the same table?

                推薦答案

                使用多表的自聯(lián)接 UPDATE 語法:

                Use a self-join with the multiple table UPDATE syntax:

                UPDATE `table` AS t1 JOIN `table` AS t2 ON t2.slNo = 5
                SET    t1.Name = t2.Name, t1.Quali = t2.Quali, t1.Exp = t2.Exp
                WHERE  t1.slNo = 3
                

                這篇關于Mysql 用同一表中的另一行值更新一行的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關文檔推薦

                store_result() and get_result() in mysql returns false(mysql 中的 store_result() 和 get_result() 返回 false)
                Call to undefined function mysqli_result::num_rows()(調(diào)用未定義的函數(shù) mysqli_result::num_rows())
                PHP Prepared Statement Problems(PHP 準備好的語句問題)
                mysqli_fetch_array returning only one result(mysqli_fetch_array 只返回一個結(jié)果)
                PHP MySQLi Multiple Inserts(PHP MySQLi 多次插入)
                How do I make sure that values from MySQL keep their type in PHP?(如何確保 MySQL 中的值在 PHP 中保持其類型?)

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

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

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

                          主站蜘蛛池模板: 久久久久av | 久久久久av| 国产乱码精品一区二区三区中文 | 永久av| 国产精品一区视频 | 色婷婷综合久久久中字幕精品久久 | av日韩精品| 国产丝袜一区二区三区免费视频 | 亚洲精品一区二区网址 | 成人久久久 | 亚洲精品自在在线观看 | 欧美精品一区二区三区四区五区 | 一本一道久久a久久精品综合蜜臀 | 99久久免费精品 | 中文字幕在线免费观看 | 国产精品自产拍 | 亚洲欧美高清 | 欧美日韩久久精品 | 欧洲一级毛片 | 中文字幕亚洲精品 | 成人免费毛片在线观看 | 久久精品小视频 | 亚洲电影在线播放 | 成人蜜桃av | 伊人久久综合 | 一本大道久久a久久精二百 国产成人免费在线 | 美女久久久久久久 | 亚洲福利在线观看 | 国产中文字幕在线观看 | 一区二区三区欧美 | 99re6热在线精品视频播放 | 男人天堂网址 | 欧美激情一区二区三级高清视频 | 天天视频一区二区三区 | 国产高清一区二区三区 | 不卡一二区 | 91成人午夜性a一级毛片 | 午夜精品一区二区三区在线视频 | 国产在线精品一区二区三区 | 欧美伊人久久久久久久久影院 | 国产精品不卡一区 |