GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  Visual Basic
Go To First  |  Previous Question  |  Next Question 
 Visual Basic  |  Question 411 of 453    Print  
difference between subquery and coquery

  
Total Answers and Comments: 3 Last Update: December 22, 2006     Asked by: Praveen Vijay 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 14, 2006 15:24:26   #1  
Minhajul Islam        

RE: difference between subquery and coquery

A subquery is called a query with in the query. Such as

select n1 n2 from table1 where in n1 not in(select n1 from table2)

while main query is the only query like

select n1 n2 from table1


 
Is this answer useful? Yes | No
November 30, 2006 00:40:29   #2  
kiran        

RE: difference between subquery and coquery

Subquery: The subquery will be executed once for all the rows of main query but the co query/co related query will be executed for each selected row of main query.

Suppose 10 rows are returened from main query then sub query will be executed only once but the co query will be executed 10 times.

Subquery: Select a from table1 where a in(select aa from table2);

co query: Select a from table1 where p (select pp from table2 where aa table1.a)


 
Is this answer useful? Yes | No
December 22, 2006 05:58:51   #3  
kumaran.vijay        

RE: difference between subquery and coquery

Subquery:-

A subquery is the query which contains inner query and outer query where the inner query is excuted first and send the output to the outer query

Eg:- select * from t1 where t1.c1 in (select t2.c1 from t2)

A coquery is the query which contains inner query and outer query where the inner query is excuted first and send the output to the outer query

Eg:- select * from t1 where t1.c1 > (select t2.c1 from t2 where t1.c3 t2.c3)

T1 Table Name C1 C3 are the column names


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape