Topic: SQL*Plus and PL/SQL >> correlated subquery clarification
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Title: correlated subquery clarification |
| muzu |
Posted: Aug 28, 2007 11:07:08 AM |
Total Post: 37
Joined: Aug, 2007
|
Can anyone explain me when we use correlated subqueries rather than nested subqueries.
Do all the correlated subqueries can be written in nested subqueries form as well ?
What are the major conditions that apply whenever we write a correlated subquery(regarding the performance of a query) and why we go for it ?
|
|
|
Priya |
| Posted: Aug 29, 2007 08:29:03 AM | |
|
Total Post: 19
Joined: Jul, 2007
|
A correlated subquery is a subquery that uses the values from the outer query. We will use it when we need to check some condition which takes the value from the outer query.
For eg;
select book_key, store_key, quantity from sales s
where quantity < (select max(quantity)from sales
where book_key = s.book_key);
Hope this example will help you to understand correlated subquery.
Regards,
Priya
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gopu Gopi | 334 |
| Gitesh Trivedi | 322 |
| Vinoth Kumar | 264 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|