# 2.3. JOINS

**JOINS** được sử dụng để nối hai bảng theo chiều ngang với mỗi hàng kết quả đều chứa thông tin từ cả hai bảng bên trái và bên phải.

**<span style="mso-list: Ignore;">a)<span style="font-style: normal; font-variant: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';"> </span></span>Outer Joins &amp; Inner Join**

**Outer Joins** &amp; **Inner Join** sử dụng các điều kiện để khớp các hàng từ hai bảng thông qua mệnh đề ON, thông thường là sử dụng các khóa, Tuy nhiên, cũng có nhiều trường hợp các hàng khớp với nhau thông qua các cột không phải khóa. Ititan cung cấp 4 loại **Outer Join** là: Left join, Right join và Full join

**<span style="mso-list: Ignore;">b)<span style="font-style: normal; font-variant: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';"> </span></span>Cross Join**

**Cross Join** là phép Joins không cần điều kiện, mỗi hàng từ bảng đầu tiên sẽ được kết hợp với tất cả các hàng từ bảng thứ hai. **Cross Join** thực hiện phép nhân Descartes (Cartesian product) giữa các bảng. Điều này có nghĩa là nó sẽ kết hợp từng hàng của bảng đầu tiên với từng hàng của bảng thứ hai.

**<span style="mso-list: Ignore;">c)<span style="font-style: normal; font-variant: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';"> </span></span>Minh họa:**

![](https://book.inetcloud.vn/uploads/images/gallery/2024-07/embedded-image-wi6lwazo.png)