Home
Certification Preparation
Microsoft
SQL Server exams
Do you all use sub select very often?
N2IT
The coding is a little bit different. I'm trying to get the hang of them.
Find more posts tagged with
Comments
NotHackingYou
Sub queries you mean - like this?
SELECT SalesPersonName FROM SalesPeople WHERE SalesPersonID IN (SELECT SalesPersonID FROM Sales WHERE SaleAmount > 5000)
Obviously this is an over simplified example and could be accomplished in a single query - but the answer to your question is yes I use them quite frequently. As a general rule, I try to stay away from going more than ~5 levels deep.
N2IT
They were referring to them as sub selects not sub queries, I have written sub queries before, although I normally write joins from the data I analyze and report on. They look like they might be in some sort of XML format when they are ran. I like the aggregate function on the second piece of your query
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of