RIGHT JOIN 可以用來建立右外部連接
RIGHT JOIN 可以用來建立左外部連接,查詢的 SQL 敘述句 RIGHT JOIN 左側資料表 (table_name1) 的所有記錄都會加入到查詢結果中,即使右側資料表 (table_name2) 中的連接欄位沒有符合的值也一樣。
1 | SELECT table_column1, table_column2... |
Example
1 | SELECT customers.C_Id,customers.Name,customers.Address,customers.Phone,customers.Salary,orders.Order_No,orders.Product,orders.Product,orders.Quantity |
