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

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

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

    1. 在 MySQL 查詢中,為什么使用 join 而不是 where?

      In MySQL queries, why use join instead of where?(在 MySQL 查詢中,為什么使用 join 而不是 where?)

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

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

              <tfoot id='WirE4'></tfoot>

              1. <legend id='WirE4'><style id='WirE4'><dir id='WirE4'><q id='WirE4'></q></dir></style></legend>
                本文介紹了在 MySQL 查詢中,為什么使用 join 而不是 where?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                好像把兩個或多個表組合起來,我們可以使用join或where.一個比另一個有什么優勢?

                It seems like to combine two or more tables, we can either use join or where. What are the advantages of one over the other?

                推薦答案

                任何涉及多個表的查詢都需要某種形式的關聯來將表A"的結果鏈接到表B".這樣做的傳統 (ANSI-89) 方法是:

                Any query involving more than one table requires some form of association to link the results from table "A" to table "B". The traditional (ANSI-89) means of doing this is to:

                1. 在FROM子句中用逗號分隔的列表列出涉及的表
                2. 在 WHERE 子句中寫出表之間的關聯

                1. List the tables involved in a comma separated list in the FROM clause
                2. Write the association between the tables in the WHERE clause

                SELECT *
                  FROM TABLE_A a,
                       TABLE_B b
                 WHERE a.id = b.id
                

                這是使用 ANSI-92 JOIN 語法重寫的查詢:

                Here's the query re-written using ANSI-92 JOIN syntax:

                SELECT *
                  FROM TABLE_A a
                  JOIN TABLE_B b ON b.id = a.id
                

                從性能的角度來看:

                <小時>

                在支持(Oracle 9i+、PostgreSQL 7.2+、MySQL 3.23+、SQL Server 2000+)的情況下,使用任何一種語法都沒有性能優勢.優化器將它們視為相同的查詢.但是更復雜的查詢可以從使用 ANSI-92 語法中受益:

                From a Performance Perspective:


                Where supported (Oracle 9i+, PostgreSQL 7.2+, MySQL 3.23+, SQL Server 2000+), there is no performance benefit to using either syntax over the other. The optimizer sees them as the same query. But more complex queries can benefit from using ANSI-92 syntax:

                • 能夠控制JOIN順序——掃描表的順序
                • 能夠在加入之前對表應用過濾條件

                使用 ANSI-92 JOIN 語法而不是 ANSI-89 的原因有很多:

                There are numerous reasons to use ANSI-92 JOIN syntax over ANSI-89:

                • 更具可讀性,因為 JOIN 條件與 WHERE 子句分開
                • 不太可能錯過 JOIN 條件
                • 對 INNER 以外的 JOIN 類型提供一致的語法支持,使查詢易于在其他數據庫上使用
                • WHERE 子句僅用于過濾所連接表的笛卡爾積

                ANSI-92 JOIN 語法是模式,而不是反模式:

                ANSI-92 JOIN syntax is pattern, not anti-pattern:

                • 查詢的目的更明顯;應用程序使用的列是明確的
                • 它遵循盡可能使用嚴??格類型的模塊化規則.顯式幾乎普遍更好.

                由于不熟悉和/或舒適,我認為繼續使用 ANSI-89 WHERE 子句而不是 ANSI-92 JOIN 語法沒有任何好處.有些人可能會抱怨 ANSI-92 語法更冗長,但這正是它明確的原因.越明確,越容易理解和維護.

                Short of familiarity and/or comfort, I don't see any benefit to continuing to use the ANSI-89 WHERE clause instead of the ANSI-92 JOIN syntax. Some might complain that ANSI-92 syntax is more verbose, but that's what makes it explicit. The more explicit, the easier it is to understand and maintain.

                這篇關于在 MySQL 查詢中,為什么使用 join 而不是 where?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 數據幀讀取?)
                  <tfoot id='kegC2'></tfoot>
                1. <i id='kegC2'><tr id='kegC2'><dt id='kegC2'><q id='kegC2'><span id='kegC2'><b id='kegC2'><form id='kegC2'><ins id='kegC2'></ins><ul id='kegC2'></ul><sub id='kegC2'></sub></form><legend id='kegC2'></legend><bdo id='kegC2'><pre id='kegC2'><center id='kegC2'></center></pre></bdo></b><th id='kegC2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='kegC2'><tfoot id='kegC2'></tfoot><dl id='kegC2'><fieldset id='kegC2'></fieldset></dl></div>
                        <tbody id='kegC2'></tbody>

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

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

                        • 主站蜘蛛池模板: 欧美激情在线精品一区二区三区 | 中文字幕在线一区二区三区 | 亚洲日韩中文字幕一区 | 欧美日韩不卡合集视频 | 国产在线对白 | 国产精品久久久久久久一区探花 | 国产欧美精品区一区二区三区 | 黄色片在线观看网址 | 日韩欧美国产精品综合嫩v 一区中文字幕 | 日韩a| 成人一区二区三区 | 成人久久18免费网站图片 | 久久久久国产精品午夜一区 | 国产精品一区二区久久精品爱微奶 | 欧美成人一区二免费视频软件 | 欧美一级片免费看 | 亚洲午夜精品久久久久久app | 国产精品视频偷伦精品视频 | 精品成人在线观看 | 波多野吉衣久久 | 亚洲午夜在线 | 丁香久久| 日韩中文字幕一区二区 | 日本一区二区三区在线观看 | 九九热在线观看视频 | 天堂久久久久久久 | 激情五月综合 | 一区视频 | 在线天堂免费中文字幕视频 | 青青久久| 99久久精品一区二区毛片吞精 | 日韩一级免费 | 中文字幕一区在线 | 国产一级一片免费播放 | 成人高清视频在线观看 | 日韩成人免费中文字幕 | 久久亚洲一区二区三 | 亚州影院| 成人免费视频一区 | 神马久久久久久久久久 | 美女天天操 |