Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Could anyone clearly explain the diference between sub
query and correlated sub query?

Answer Posted / sriram

Correlated subquery runs once for each row selected by the
outer query. It contains a reference to a value from the
row selected by the outer query.

Nested subquery runs only once for the entire nesting
(outer) query. It does not contain any reference to the
outer query row.

For example

Correlated Subquery:

select e1.empname e1.basicsal e1.deptno from emp e1 where
e1.basicsal (select max(basicsal) from emp e2 where
e2.deptno e1.deptno)

Nested Subquery:

select empname basicsal deptno from emp where (deptno
basicsal) in (select deptno max(basicsal) from emp group by
deptno)



Please let me know if I am wrong...............

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of db2 optimizer?

1107


What is view db2?

1063


Can you use max on a char column?

1091


How to get the ddl of a table in db2?

1125


What is a db2 tablespace?

1059


What is a db2 collection?

1030


Give a brief description of db2 isolation levels?

1061


On which levels locks can be applied?

1121


What do you mean by cursor?

988


What is universal database?

1066


How do you select a row using indexes in db2?

1130


Define data page.

1056


What are the contents of a dclmgen?

1120


How to find primary key of a table in db2?

1057


How can record locking be achieved in those DB2 versions which do not support it?

1072