Sql sub query
what is sql sub query? how can v use ...can any one explain
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Aug 7, 2012, 4:04 AM EDT
http://www.simple-talk.com/sql/sql-training/subqueries-in-sql-server/
In simple sub query is an inner query.
For eg,
There are duplicate rows inside table and i want to find all columns for such a duplicate row..
Select * from tblecsession where Id in (select ID from tblecsession group by ID having (COUNT(*) > 1))Jignesh TrivediRank #16 · 50.3K reputationPosted Aug 7, 2012, 7:29 PM EDT
A subquery is a query that is nested inside a SELECT, INSERT, UPDATE, or DELETE statement, or inside another subquery. Subquery is an inner query or inner select, while the statement containing a subquery is also called an outer query or outer select.
Please refer
http://msdn.microsoft.com/en-us/library/aa213252%28v=sql.80%29.aspx
http://blog.sqlauthority.com/2010/06/07/sql-server-subquery-or-join-various-options-sql-server-engine-knows-the-best-part-2/
hope this will help you.