Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Push the filter condition after the join.

820957Dec 10 2011 — edited Dec 15 2011
Hi All,

I have a simple question on joining two tables it would be really great if you can help me to understand the concept here.
I have two tables

T1--> 100 rows
T2--> 1,000,000 rows

I have a filter on T1 so it will return only 10 rows

SELECT COUNT (*)
FROM T1, T2
WHERE T1.ID = T2.ID
AND T1.NAME = 'JOHN'
AND T2.CITY = 'AAAA'

As per my understanding oracle will apply the filters on t1 and t2 and then join the tables.

Is there any way i can apply the filter on t1 join it with t2 and apply the second filter on the result set?

Thanks in advance!!!

Edited by: Shadowcat on Dec 10, 2011 8:27 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 12 2012
Added on Dec 10 2011
9 comments
535 views