What Is a Subquery in a SELECT Query Statement in MS SQL Server?
Submitted by: AdministratorA subquery is a SELECT statement used as part of the selection criteria of the main SELECT statement. The subquery specified in the WHERE clause will be evaluated repeated on each row of the selection base table. The output of the subquery will be used in the final evaluation of the criteria. Usually, subqueries are used in the following Boolean operations:
* "expression IN (subquery)" - True if the expression matches one of the returned values from the subquery.
* "expression NOT IN (subquery)" - True if the expression does not match any of the returned values from the subquery.
* "EXISTS (subquery)" - True if the subquery returns one or more rows.
* "NOT EXISTS (subquery)" - True if the subquery returns no rows.
Submitted by: Administrator
* "expression IN (subquery)" - True if the expression matches one of the returned values from the subquery.
* "expression NOT IN (subquery)" - True if the expression does not match any of the returned values from the subquery.
* "EXISTS (subquery)" - True if the subquery returns one or more rows.
* "NOT EXISTS (subquery)" - True if the subquery returns no rows.
Submitted by: Administrator
Read Online MS SQL Server Job Interview Questions And Answers
Top MS SQL Server Questions
☺ | How To Select Some Specific Rows from a Table in MS SQL Server? |
☺ | PHP MSSQL - How To Display a Past Time in Days, Hours and Minutes? |
☺ | Does Index Slows Down INSERT Statements? |
☺ | How To Execute the Cursor Queries with "OPEN" Statements? |
☺ | What Happens If Strings Are Casted into Wrong Code Pages in MS SQL Server? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Sybase Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |