View previous topic :: View next topic
|
Author |
Message |
venkagov
New User
Joined: 10 Aug 2006 Posts: 6 Location: Chennai
|
|
|
|
Hi,
Can anyone tell me will there be any difference in performance between the two queries below.
Query 1:
Select A.EMPNO,A.EMPNAME,A.DEPTNO,B.DEPTNAME
FROM EMP A,DEPT B
WHERE A.DEPTNO = B.DEPTNO
I think above query uses cartesian product.
Query 2:
Select A.EMPNO,A.EMPNAME,A.DEPTNO,B.DEPTNAME
FROM EMP A INNER JOIN DEPT B
ON A.DEPTNO = B.DEPTNO
Above query uses join.
Join is better than cartesian product right?
Let me know if I am wrong.
Also please tell me some way of comparing the perfomance of queries. |
|
Back to top |
|
|
anamikak
New User
Joined: 10 May 2006 Posts: 64 Location: Singapore
|
|
|
|
query 1 and 2 are just the same. They represent inner join.
query 1 and 2 represent two equivalent syntax for performing inner join. when INNER JOIN is specified, the WHERE keyword is replaced with the ON keyword. |
|
Back to top |
|
|
anamikak
New User
Joined: 10 May 2006 Posts: 64 Location: Singapore
|
|
|
|
Also, performance wise there is not going to be any difference.
Anamika |
|
Back to top |
|
|
venkagov
New User
Joined: 10 Aug 2006 Posts: 6 Location: Chennai
|
|
|
|
Thanks Anamika. |
|
Back to top |
|
|
|