久久久久久久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'>

                        • 主站蜘蛛池模板: 亚洲视频一区在线 | 亚洲国产精品久久久 | 91久久网站 | 天天操天天天干 | 国产午夜精品理论片a大结局 | 国产精品成人在线播放 | 一区二区福利视频 | 2019天天操 | 久久人人爽人人爽人人片av免费 | 亚洲精品电影在线观看 | 91爱啪啪| 天天干天天爽 | 亚洲精品粉嫩美女一区 | 国产伦精品一区二区 | 97精品超碰一区二区三区 | 视频1区 | 羞羞色网站 | 日日噜| 天天操天天射综合 | 久久久精品久久久 | 亚洲一区二区三区在线播放 | 黄a网站| 日本久久久影视 | 成人免费在线观看 | 亚洲精品久久久久avwww潮水 | 亚洲国产精品美女 | 一级毛片在线看 | 91亚洲国产成人精品一区二三 | 国产精品爱久久久久久久 | 少妇特黄a一区二区三区88av | 精品国产乱码久久久久久a丨 | 中文字幕一区二区在线观看 | 国内自拍真实伦在线观看 | 一区二区国产在线 | 亚洲91 | 91久久国产综合久久 | 日韩免费在线观看视频 | 日韩有码在线播放 | 亚洲三区在线观看 | 一区二区三区在线播放视频 | 91视频在线 |