我正在使用 SQL Server 2008。
有什么区别:
在Where
子句中有条件
select customer.Id,
order.Id
from Customer customer
left outer join Order order on order.customerId = customer.Id
where
order.deleted =0
带有ON
条款的条件
select customer.Id,
order.Id
from Customer customer
left outer join Order order
on order.customerId = customer.Id
and order.deleted =0
以及两者如何比较
select customer.Id,
order.Id
from Customer customer
inner join Order order on order.customerId = customer.Id
where
order.deleted =0