创建高级联结
使用联结的时候会返回很多重复的列,而自然联结排除多次出现的列,使每一列只返回一次.
自然联结由我们自己写sql语句实现…
select customers.cust_id,orders.order_num
from customers inner join orders
on customers.cust_id = orders.cust_id;
select customers.cust_id,orders.order_num
from customers left join orders
on customers.cust_id = orders.cust_id;
左联接可通过颠倒from或者where字句中表的顺序转换为右外连接(相当于这两个是等价的)