SQLJOIN:使用、打开或在何处有区别吗?我想知道SQL对这些JOIN语句的执行方式是否有任何不同:SELECT * FROM a,b WHERE a.ID = b.IDSELECT * FROM a JOIN b ON a.ID = b.IDSELECT * FROM a JOIN b USING(ID)有表演上的差别吗?还是算法上的差异?还是只是语法糖?
3 回答
米琪卡哇伊
TA贡献1998条经验 获得超6个赞
FROM T1,T2,T3....WHERE T1.ID = T2.ID AND T1.foo = 'bar' AND T2.fish = 42 AND T1.ID = T3.IDFROM T1 INNER JOIN T2 ON T1.ID = T2.ID INNER JOIN T3 ON T1.ID = T3.IDWHERE T1.foo = 'bar' AND T2.fish = 42
=*
, *=
不使用“JointheWHERE”(隐式)的原因是外部联接的错误结果。 如果您使用显式外部联接+隐式内部连接,则仍然会得到不可靠的结果+您的用法不一致
万千封印
TA贡献1891条经验 获得超3个赞
WHERE
SELECT p.Product, o.OrderFROM Product pINNER JOIN Order oON o.OrderID = p.OrderID
ON
WHERE
WHERE
SELECT p.Product, o.OrderFROM Product pINNER JOIN Order oON o.OrderID = p.OrderIDWHERE o.Category = 'IT'
WHERE
添加回答
举报
0/150
提交
取消