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

  • <small id='TBTQU'></small><noframes id='TBTQU'>

    <tfoot id='TBTQU'></tfoot>

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

        <legend id='TBTQU'><style id='TBTQU'><dir id='TBTQU'><q id='TBTQU'></q></dir></style></legend>
        • <bdo id='TBTQU'></bdo><ul id='TBTQU'></ul>

      1. 將從不同查詢返回的行附加到一個

        Appending rows returned from different queries into one(將從不同查詢返回的行附加到一個)
            <tbody id='vUgo6'></tbody>

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

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

            • <bdo id='vUgo6'></bdo><ul id='vUgo6'></ul>
            • <legend id='vUgo6'><style id='vUgo6'><dir id='vUgo6'><q id='vUgo6'></q></dir></style></legend>
              • <tfoot id='vUgo6'></tfoot>
                1. 本文介紹了將從不同查詢返回的行附加到一個的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有 3 個查詢,它們從 3 個不同的表(帶連接)中獲取數(shù)據(jù),并且它們的列名幾乎相同(或者我使用 AS 關鍵字使它們相同).完成 3 個查詢后,我想合并它們的結果,因此看起來它們來自一張表.請看下面的代碼.

                  I am having 3 queries, which takes data from 3 different tables (with joins) and their column names are pretty much same (or I made them same by using ASkeyword). Once the 3 queries are completed, I want to combine their results, so it looks like they are coming from one table. Please have a look at the below codes.

                  第一個查詢

                  SELECT Client_Portfolio.*,
                  Client.Name,
                  Provider.Name,
                  "One" AS Income_Type,
                  One.`One_Gross_Fee` AS "Gross_Fee",
                  One.`One_V_Fee` AS "V_Fee",
                  One.`One_E_Fee` AS "E_Fee",
                  One.`One_I_Fee` AS "I_Fee",
                  One.`One_Tax_Provision` AS "Tax_Provision",
                  One.`One_Net_Income` AS "Net_Income",
                  "N/A" AS VAT,
                  One.`Updated_Date`
                  FROM Client_Portfolio
                  INNER JOIN Portfolio ON Portfolio.`idPortfolio` = Client_Portfolio.`idPortfolio`
                  INNER JOIN Client ON Client.idClient = Client_Portfolio.idClient
                  JOIN Provider ON Provider.idProvider = Portfolio.idProvider
                  INNER JOIN One ON One.idPortfolio = Portfolio.idPortfolio
                  

                  第二次查詢

                  SELECT Client_Portfolio.*,
                  Client.Name,
                  Provider.Name,
                  "Two" AS Income_Type,
                  Two.`Two_Gross_Fee` AS "Gross_Fee",
                  Two.`Two_V_Fee` AS "V_Fee",
                  Two.`Two_E_Fee` AS "E_Fee",
                  Two.`Two_I_Fee` AS "I_Fee",
                  Two.`Two_Tax_Provision` AS "Tax_Provision",
                  Two.`Two_Net_Income` AS "Net_Income",
                  Two.`Two_Vat` AS VAT,
                  Two.`Updated_Date`
                  FROM Client_Portfolio
                  INNER JOIN Portfolio ON Portfolio.`idPortfolio` = Client_Portfolio.`idPortfolio`
                  INNER JOIN Client ON Client.idClient = Client_Portfolio.idClient
                  JOIN Provider ON Provider.idProvider = Portfolio.idProvider
                  INNER JOIN Two ON Two.idPortfolio = Portfolio.idPortfolio
                  

                  第三次查詢

                  SELECT Client_Portfolio.*,
                  Client.Name,
                  Provider.Name,
                  "Three" AS Income_Type,
                  Three.`Three_Gross_Fee` AS "Gross_Fee",
                  "N\A" AS "V_Fee",
                  Three.`Three_E_Fee` AS "E_Fee",
                  "N\A" AS "I_Fee",
                  Three.`Three_Tax_Provision` AS "Tax_Provision",
                  Three.`Three_Net_Income` AS "Net_Income",
                  Three.`Three_Vat` AS VAT,
                  Three.`Updated_Date`
                  FROM Client_Portfolio
                  INNER JOIN Portfolio ON Portfolio.`idPortfolio` = Client_Portfolio.`idPortfolio`
                  INNER JOIN Client ON Client.idClient = Client_Portfolio.idClient
                  JOIN Provider ON Provider.idProvider = Portfolio.idProvider
                  INNER JOIN Three ON Three.idPortfolio = Portfolio.idPortfolio
                  

                  完成這些查詢后,我想合并它們的結果.這意味著,2nd Query 返回的行將附加在 1st 查詢返回的行之后. 第三個查詢返回的行將附加在 1st 查詢返回的行之后第二問.最后,我想按 Updated_Date

                  Once these queries are done, I want to combine their results. Which means, Rows returned by the 2nd Query will be appended after the rows returned by the 1st query. Rows returned by the 3rd query will be appended after the rows returned by the 2nd query. Finally, I want to sort the final result by Updated_Date

                  我該怎么做?

                  推薦答案

                  使用 UNION 組合查詢:

                  SELECT one_fields FROM Client_Portfolio ...
                  UNION
                  SELECT two_fields FROM Client_Portfolio ...
                  UNION
                  SELECT three_fields FROM Client_Portfolio ...
                  

                  排序可以通過在最后一個查詢后附加一個 order by 子句來完成,如下所示:

                  Sorting can be done by appending an order by clause after the last query, as follows:

                  SELECT one_fields FROM Client_Portfolio ...
                  UNION
                  SELECT two_fields FROM Client_Portfolio ...
                  UNION
                  SELECT three_fields FROM Client_Portfolio ...
                  ORDER BY field1, field2, field3...;
                  

                  注意field1field2...可以是字段名稱或字段編號(從1開始).

                  Note that field1, field2... can be field names or field numbers (starting from 1).

                  這篇關于將從不同查詢返回的行附加到一個的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關文檔推薦

                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數(shù)根據(jù) 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 函數(shù)的 ignore 選項是忽略整個事務還是只是有問題的行?) - IT屋-程序員軟件開發(fā)技
                  Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時出錯,使用 for 循環(huán)數(shù)組)
                  pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調用 o23.load 時發(fā)生錯誤 沒有合適的驅動程序)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數(shù)據(jù)庫表作為 Spark 數(shù)據(jù)幀讀取?)
                      <tbody id='l7DOG'></tbody>

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

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

                          <bdo id='l7DOG'></bdo><ul id='l7DOG'></ul>
                          <legend id='l7DOG'><style id='l7DOG'><dir id='l7DOG'><q id='l7DOG'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 成人毛片网站 | 国产精品久久国产精品 | 天天曰夜夜操 | 在线黄av | 国产精品a级 | 日韩在线免费视频 | 黄色在线观看网站 | 精品一区国产 | 欧美精品网 | 看片国产 | 欧美一级片免费看 | 精品国产精品三级精品av网址 | 日韩三级| 在线观看国产视频 | 精品三级在线观看 | 精品欧美乱码久久久久久 | 日本三级在线 | 亚洲人成人一区二区在线观看 | 成人 在线 | 特黄毛片 | 亚洲精品一级 | 日韩二区 | 国产精品成人69xxx免费视频 | 久久大陆 | 天天操夜夜操免费视频 | 一级片av | 久久精品一级 | 国产一区二区三区视频 | 国产精品视频999 | 五月婷婷中文 | 国产成人久久精品一区二区三区 | 91麻豆蜜桃一区二区三区 | 在线永久看片免费的视频 | 国产区免费视频 | 亚洲在线中文字幕 | 亚洲丝袜天堂 | aaaaaaa片毛片免费观看 | 伦理片97 | 亚洲天堂中文字幕 | 国产二区在线播放 | 国产免费av在线 |