Difference between Inner join vs Where ?

Answer

CREATETABLE table1 (
  id INT,
  name VARCHAR(20));CREATETABLE table2 (
  id INT,
  name VARCHAR(20));

The execution plan for the query using the inner join:

-- with inner join

EXPLAIN PLANFORSELECT*FROM table1 t1
INNERJOIN table2 t2 ON t1.id = t2.id;SELECT*FROMTABLE(DBMS_XPLAN.DISPLAY);-- 0 select statement-- 1 hash join (access("T1"."ID"="T2"."ID"))-- 2 table access full table1-- 3 table access full table2

And the execution plan for the query using a WHERE clause.

-- with where clause

EXPLAIN PLANFORSELECT*FROM table1 t1, table2 t2
WHERE t1.id = t2.id;SELECT*FROMTABLE(DBMS_XPLAN.DISPLAY);-- 0 select statement-- 1 hash join (access("T1"."ID"="T2"."ID"))-- 2 table access full table1-- 3 table access full table2

All oracle Questions

Ask your interview questions on oracle

Write Your comment or Questions if you want the answers on oracle from oracle Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---