SQL INNER JOIN syntax

后端 未结 7 2185
夕颜
夕颜 2020-12-01 05:16

the two bits of SQL below get the same result

SELECT c.name, o.product  
FROM customer c, order o  
WHERE c.id = o.cust_id  
AND o.value = 150  

SELECT c.na         


        
7条回答
  •  忘掉有多难
    2020-12-01 05:50

    Oracle was late in supporting the JOIN ... ON (ANSI) syntax (not until Oracle 9), that's why Oracle developers often don't use it.

    Personally, I prefer using ANSI syntax when it is logically clear that one table is driving the query and the others are lookup tables. When tables are "equal", I tend to use the cartesian syntax.

    The performance should not differ at all.

提交回复
热议问题