本文介紹了兩種 SQL 連接表示法之間有什么區別?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
SQL 1: select * from t1 join t2 on t1.f1 = t2.f2
SQL 2: select * from t1,t2 where t1.f1 = t2.f2
它們返回的結果是一樣的.它們之間有什么區別嗎?例如,在 DBMS 中如何運行它們,或者在查詢計劃中?
The results that they return are same. Are there any differences between them? For example, in how the DBMS runs them, or in the query plan?
推薦答案
這兩個查詢在操作上沒有區別.
There is no operational difference between the two queries.
然而,顯式連接符號是更好的學習和使用風格;將另一個留給(尚未更改的)遺留代碼.
However, the explicit join notation is the better style to learn and use; leave the other for (as yet unchanged) legacy code.
這篇關于兩種 SQL 連接表示法之間有什么區別?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!