sel a.t1,b.t1 from emp a left outer join dept b ON
a.id=b.id where b.deptno=10;
sel a.t1,b.t1 from emp a left outer join dept b ON
a.id=b.id and b.deptno=10;
what is the difference on the above 2 queries?

Answer Posted / tdguy

This is a good question. If we look at the explain plans,we
would be able to understand the difference.
1. In the first query, the condition given in where clause
is applied after the left outer join process on the tables.
This means that it is a plain left outer jon on id column
between the tables and the where condition is applied after
the join process. This can be seen in the explain plan as
"by way of a RowHash match scan with a condition".
2. In the second query, the condition given in and
statement clause is applied along with the left outer join
process on the tables. This means that it is a left outer
jon on id column between the tables with table b with only
one row. This can be seen in the explain plan as
"by way of a RowHash match scan with no residual conditions
".

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Discuss the advantages of using partitioned primary index in a query?

616


What are normalization, first normal form, second normal form and third normal form?

723


What do you mean by teradata intelliflex?

711


Let us say there is a file that consists of 100 records out of which we need to skip the first and the last 20 records. What will the code snippet?

817


What is the purpose of joins in teradata?

629






What is oltp?

649


How would you load a very large file in teradata in general? What utility would you use for it? Why?

722


What is the purpose of joins in teradata and what are the available join types?

640


Did you write stored procedures in teradata?

708


how do we write scripts in unix how to execute scripts in real time anybody please needfull or give me number i will cal u

1364


What is multi insert?

713


What are the newly developed features of Teradata?

664


How is MLOAD Teradata Server restarted after execution?

755


There is a column with date in it. If I want to get just month how it can be done? Can I use sub string?

738


What do you mean by caching in teradata?

702