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?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / aarsh dave
The first query will only show the records that are matching
on id and deptno = 10.
The second query will show all the records from table A with
B.t1 as NULL wherever deptno <> 10.
| Is This Answer Correct ? | 5 Yes | 6 No |
How many tables can you join in v2r5?
If the table does not have duplicates then which utility you can suggest to load the data ?
How can bottlenecks be identified?
What is smp and mpp platforms?
Why Multiload does not supports USI and supports NUSI?
can we load 10 millions of records into target table by using tpump?
What is the process to restart the multiload if it fails?
What are the functions involved in shared information architecture?
what is DYNAMIC SQL in TD?
How teradata makes sure that there are no duplicate rows being inserted when its a set table?
What are the frequently used data types in teradata?
what is identity columns in TD?