GeekInterview.com
Series: Subject: Topic:
Question: 14 of 214

what is a sub query and co-related sub query?

Asked by: jayababuhrd | Member Since Jan-2012 | Asked on: Jan 26th, 2012

View all questions by jayababuhrd

Showing Answers 1 - 1 of 1 Answers
indira

Answered On : Feb 1st, 2012

Sub query: A sub query is executed once for the parent statement.

Correlated Sub query: Correlated sub query 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.

Example:
Select e1.empname, e1.basicsal, e1.deptno
From emp e1
Where e1.basicsal = (Select max(basicsal) From emp e2 Where e2.deptno = e1.deptno)

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.