x

Difference between a sub-query and a nested query?

Can anybody give the best exaplanation for the diffrence between sub-query and nested query?

more ▼

asked Mar 18, 2010 at 03:34 PM in Default

avatar image

venkatreddy
562 29 31 36

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

As grant says, the things you have mentioned are one and the same.

You basically have:

A sub-query - this is a query which is used as part of a larger query. Much as you would select from a table, you can select from a sub-query.

A correlated sub-query - this is a particular type of sub-query that references the outer query - it's used for exists, having etc.

A scalar sub-query - this is where you use a sub-query more like a column - to pick up a single value from somewhere.

Hope that helps...

more ▼

answered Mar 18, 2010 at 05:38 PM

avatar image

Matt Whitfield ♦♦
29.5k 62 66 88

(comments are locked)
10|1200 characters needed characters left

To my knowledge, that's two terms for the same concept.

more ▼

answered Mar 18, 2010 at 03:43 PM

avatar image

Grant Fritchey ♦♦
137k 20 42 81

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1066
x96
x48
x21

asked: Mar 18, 2010 at 03:34 PM

Seen: 4531 times

Last Updated: Mar 19, 2010 at 05:03 AM

Copyright 2016 Redgate Software. Privacy Policy