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

  • <legend id='iFyRa'><style id='iFyRa'><dir id='iFyRa'><q id='iFyRa'></q></dir></style></legend>

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

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

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

    2. <tfoot id='iFyRa'></tfoot>

        MySQL - 如何將列反透視為行?

        MySQL - How to unpivot columns to rows?(MySQL - 如何將列反透視為行?)
            <i id='aVEt4'><tr id='aVEt4'><dt id='aVEt4'><q id='aVEt4'><span id='aVEt4'><b id='aVEt4'><form id='aVEt4'><ins id='aVEt4'></ins><ul id='aVEt4'></ul><sub id='aVEt4'></sub></form><legend id='aVEt4'></legend><bdo id='aVEt4'><pre id='aVEt4'><center id='aVEt4'></center></pre></bdo></b><th id='aVEt4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='aVEt4'><tfoot id='aVEt4'></tfoot><dl id='aVEt4'><fieldset id='aVEt4'></fieldset></dl></div>

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

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

                <tbody id='aVEt4'></tbody>

                • <bdo id='aVEt4'></bdo><ul id='aVEt4'></ul>
                • <tfoot id='aVEt4'></tfoot>
                • 本文介紹了MySQL - 如何將列反透視為行?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  此時我可能看的不是很清楚,但我在 MySQL 中有一個表,如下所示:

                  I'm probably not seeing things very clear at this moment, but I have a table in MySQL which looks like this:

                  ID | a  | b  | c 
                  1  | a1 | b1 | c1
                  2  | a2 | b2 | c2
                  

                  出于某種原因(實際上是另一個表上的連接 - 基于 ID,但我認為如果有人可以幫助我完成這部分,我可以自己完成其余部分),我需要這些行改為這樣:

                  For some reason (actually a join on another table - based on ID, but I think if someone can help me out with this part, I can do the rest myself), I needed those rows to be like this instead:

                  1 | a1 | a
                  1 | b1 | b
                  1 | c1 | c
                  2 | a2 | a
                  2 | b2 | b
                  2 | c2 | c
                  

                  所以基本上,我需要查看如下行:IDcolumntitlevalue有什么方法可以輕松做到這一點嗎?

                  So basically, I need to view the rows like: ID, columntitle, value Is there any way to do this easily?

                  推薦答案

                  您正在嘗試反透視數據.MySQL 沒有 unpivot 功能,因此您必須使用 UNION ALL 查詢將列轉換為行:

                  You are trying to unpivot the data. MySQL does not have an unpivot function, so you will have to use a UNION ALL query to convert the columns into rows:

                  select id, 'a' col, a value
                  from yourtable
                  union all
                  select id, 'b' col, b value
                  from yourtable
                  union all
                  select id, 'c' col, c value
                  from yourtable
                  

                  參見SQL Fiddle with Demo.

                  這也可以使用 CROSS JOIN 來完成:

                  This can also be done using a CROSS JOIN:

                  select t.id,
                    c.col,
                    case c.col
                      when 'a' then a
                      when 'b' then b
                      when 'c' then c
                    end as data
                  from yourtable t
                  cross join
                  (
                    select 'a' as col
                    union all select 'b'
                    union all select 'c'
                  ) c
                  

                  參見SQL Fiddle with Demo

                  這篇關于MySQL - 如何將列反透視為行?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 數據幀讀取?)

                  <small id='3dusI'></small><noframes id='3dusI'>

                    <tbody id='3dusI'></tbody>

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

                            主站蜘蛛池模板: 欧美精品久久久 | 日韩一区二区三区在线 | 不卡在线视频 | 午夜在线影院 | 91精品国产91久久久久久 | 亚洲午夜视频在线观看 | 精品一区电影 | 亚洲国产一区二区三区 | 三级在线视频 | 日韩中文一区二区 | 中文字幕不卡在线观看 | www.99精品 | 精品一区二区三区91 | 国产视频久久 | 欧美精品欧美精品系列 | 日韩在线精品强乱中文字幕 | 午夜影院黄 | 黄色毛片在线观看 | 国产高清免费视频 | 岛国毛片 | 91在线精品一区二区 | 91麻豆久久久 | 日韩精品在线看 | 不卡一区二区在线观看 | 欧美激情a∨在线视频播放 成人免费共享视频 | 一道本在线 | 人人九九精 | 色视频网站免费 | 日韩欧美亚洲一区 | 国产精品久久二区 | 91精品国产一区二区三区香蕉 | 青青草综合 | 一区二区三区视频在线观看 | 久久久久亚洲 | 精品蜜桃一区二区三区 | 成人国产免费观看 | 久久久久久综合 | 欧美日韩一卡 | 国产精品1区2区3区 中文字幕一区二区三区四区 | 国产你懂的在线观看 | 日韩av高清 |