Many times in interview ,interviewer asked the question what are properties and different Types of Sub-Queries in sql server,at that time freshers or any experienced candidate may be confuse how to give answer, so by considering above requirement i have decided to write this blog to help job seeker and who wants to know what are properties and different Types of Sub-Queries in sql server , so let us see.
Properties of Sub-Query
- A sub-query must be enclosed in the parenthesis.
- A sub-query must be put in the right hand of the comparison operator, and
- A sub-query cannot contain an ORDER-BY clause.
- A query can contain more than one sub-query.
Types of Sub-Query
- Single-row sub-query, where the sub-query returns only one row.
- Multiple-row sub-query, where the sub-query returns multiple rows,. and
- Multiple column sub-query, where the sub-query returns multiple columns.
I hope this small blog is helpful for all job seeker and other readers, if you have any suggestion then please contact me.