joins型別名詞
在閱讀英文資料時候,經常會讀到join型別的英文單詞,以下是總結join 型別的含義:
1、cross joins,也叫做cartestian product,意思是將表A的每一行與表B的所有行組和起來,語句如下:
SQL>select * from tab1, tab2
或
SQL>select * from tab1 cross join b
2、Theta Joins : 從cross join的結果集中挑選出符合關聯條件的行,類似如下:
SQL> select * from tab1, tab2
where tab1.col1 between tab2.col1 between tab2.col2
或
SQL>select * from tab1, tab2
where tab1 join tab2 on tab1.col1 between tab2.col1 between tab2.col2
或
SQL>select * from tab1, tab2
where tab1 inner join tab2
on tab1.col1 between tab2.col1 between tab2.col2
3、Equi-Joins:是Theta join的特殊型別,關聯條件是“=”,如:
SQL>select * from tab1, tab2
where tab1.col1=tab2.col2
或
SQL>select * from tab1, tab2
where tab1 join tab2 on tab1.col1=tab2.col1
4、self-join: 是Theta關聯的特殊型別,表自己關聯自己
SQL>select * from tab1, tab1 tab2
where tab1.col1=tab2.col2
或
SQL>select * from tab1, tab1 tab2
where tab1 join tab1 tab2 on tab1.col1 = tab1.col2
5、outer-joins: 是theta joins結果集的擴充套件,顯示一個表的所有結果集,即使該表關聯條件值與另一個表不匹配。
SQL>select * from tab1, tab2
where tab1.col1=tab2.col1(+)
或
SQL>select * from tab1, tab2
where tab1 left join tab2 on tab1.col1=tab2.col1
或
SQL>select * from tab1, tab2
where tab1 left outer join tab2 on tab1.col1=tab2.col1
6、semi-joins: 一張表匹配另一個表的行,通常被寫成IN或EXISTS
SQL>select * from tab1
where tab1.col1 in (select col1 from tab2)
SQL>select * from tab1
where exists (select * from tab2 where tab1.col1=tab2.col1)
7、Anti-Joins: 返回一張表不匹配另一張表的行,通常是寫成NOT IN或NOT EXISTS
SQL>select * from tab1
where tab1.col1not in (select col1 from tab2)
SQL>select * from tab1
where not exists (select * from tab2 where tab1.col1=tab2.col1)
1、cross joins,也叫做cartestian product,意思是將表A的每一行與表B的所有行組和起來,語句如下:
SQL>select * from tab1, tab2
或
SQL>select * from tab1 cross join b
2、Theta Joins : 從cross join的結果集中挑選出符合關聯條件的行,類似如下:
SQL> select * from tab1, tab2
where tab1.col1 between tab2.col1 between tab2.col2
或
SQL>select * from tab1, tab2
where tab1 join tab2 on tab1.col1 between tab2.col1 between tab2.col2
或
SQL>select * from tab1, tab2
where tab1 inner join tab2
on tab1.col1 between tab2.col1 between tab2.col2
3、Equi-Joins:是Theta join的特殊型別,關聯條件是“=”,如:
SQL>select * from tab1, tab2
where tab1.col1=tab2.col2
或
SQL>select * from tab1, tab2
where tab1 join tab2 on tab1.col1=tab2.col1
4、self-join: 是Theta關聯的特殊型別,表自己關聯自己
SQL>select * from tab1, tab1 tab2
where tab1.col1=tab2.col2
或
SQL>select * from tab1, tab1 tab2
where tab1 join tab1 tab2 on tab1.col1 = tab1.col2
5、outer-joins: 是theta joins結果集的擴充套件,顯示一個表的所有結果集,即使該表關聯條件值與另一個表不匹配。
SQL>select * from tab1, tab2
where tab1.col1=tab2.col1(+)
或
SQL>select * from tab1, tab2
where tab1 left join tab2 on tab1.col1=tab2.col1
或
SQL>select * from tab1, tab2
where tab1 left outer join tab2 on tab1.col1=tab2.col1
6、semi-joins: 一張表匹配另一個表的行,通常被寫成IN或EXISTS
SQL>select * from tab1
where tab1.col1 in (select col1 from tab2)
SQL>select * from tab1
where exists (select * from tab2 where tab1.col1=tab2.col1)
7、Anti-Joins: 返回一張表不匹配另一張表的行,通常是寫成NOT IN或NOT EXISTS
SQL>select * from tab1
where tab1.col1not in (select col1 from tab2)
SQL>select * from tab1
where not exists (select * from tab2 where tab1.col1=tab2.col1)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/354732/viewspace-619381/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- TypeScript type 型別別名TypeScript型別
- 物件導向與函數語言程式設計的區別: 動詞-名詞與名詞-動詞的區別 - simblob物件函數程式設計
- Oracle JoinsOracle
- TypeScript 強大的型別別名TypeScript型別
- TS資料型別:型別別名/聯合型別/字面量型別/型別推論等綱要資料型別
- 檔案型別和副檔名型別
- 業務名詞
- 數學名詞
- 02-名詞
- 聊聊flink Table的Joins
- JavaScript 節點物件的型別與名稱JavaScript物件型別
- Python批量修改檔名和檔案型別Python型別
- JavaScript 裡 window, document, screen, body 這幾個名詞的區別JavaScript
- 第1節:英語中的名詞,冠詞和數詞,代詞
- golang基礎語法,定義函式型別 為已存在的資料型別起別名Golang函式資料型別
- 這五種ios簽名型別你知道多少?iOS型別
- 獲取相應副檔名的ContentType型別型別
- Oracle常用名詞解釋Oracle
- yocto-名詞介紹
- 機器學習名詞機器學習
- 技術名詞解釋
- Partition Pruning和Partition-Wise Joins
- Java中名詞的解釋Java
- 域名字尾有哪些型別?各種域名字尾名的區別型別
- react 報錯 元素隱式具有 "any" 型別,因為型別為 "string" 的表示式不能用於索引型別 "{}"。 在型別 "{}" 上找不到具有型別為 "string" 的引數的索引簽名。React型別索引
- [20180912]關於ANSI joins語法.txt
- C#學習 [型別系統] 名稱空間(12)C#型別
- linux每日命令(25):Linux檔案型別與副檔名Linux型別
- [譯]有關Kotlin型別別名(typealias)你需要知道的一切Kotlin型別
- yii別名的定義和別名的獲取以及別名的使用
- 前端音視訊的那些名詞前端
- JavaScript物件導向名詞詳解JavaScript物件
- 計組常見名詞縮寫
- 內網基礎名詞解釋內網
- 遊戲名詞設計的平衡遊戲
- DevSecOps 流程中常見名詞縮寫dev
- 「Kafka應用」名詞概念解釋Kafka
- 動詞て型變換
- 模板別名