天天看点

读SQL_SERVER_2005技术内幕

SQL语句的执行过程

(7)select c.customerid,count(o.orderid) as 'num' --第七步
(1)from Customers c --第一步
(3)left outer join Orders o --第三步
(2)on c.customerid=o.customerid --第二步
(4)where c.city='Madrid'--第四步
(5)Group by c.customerid--第五步
(6)having count(o.orderid)<3--第六步
(9)order by num--第八步
           

1.第一步执行笛卡尔乘积(交叉联接)

2.