Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is a sub-query? When would you use one?

Answer Posted / mkd

A subquery is a SELECT statement that is nested within
another T-SQL statement. A subquery SELECT statement if
executed independently of the T-SQL statement, in which it
is nested, will return a result set. Meaning a subquery
SELECT statement can standalone and is not depended on the
statement in which it is nested.

Sometimes the criteria for determining which set of records
will be affected by a SELECT, UPDATE, DELETE and/or INSERT
statement cannot be obtained by hard coding the selection
criteria. Occasionally there is a need to use the results
of a SELECT statement to help determine which records are
returned or are affected by a T-SQL statement. When a
SELECT statement is used inside another statement, the
inside SELECT statement is known as a subquery.

Is This Answer Correct ?    13 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is field in algebra?

1092


What are the new features introduced in SQL Server 2000 (or the latest release of SQL Server at the time of your interview)? What changed between the previous version of SQL Server and the current version?

1124


What are the difference between primary key and unique key? : sql server database administration

986


How to delete duplicate records based on single column from a table?

1099


What are the advantages of user-defined functions over stored procedures in sql server?

1112


what type of index will get created after executing the above statement? : Sql server database administration

1022


What are Row versions of DataRow?

1076


Explain a differential backup?

1056


How to integrate the ssrs reports in application?

1039


Explain “row_number()” in sql server with an example?

1050


How to execute a sql statement using odbc_exec()?

1211


Explain DBCC?

1009


Explain the microsoft sql server delete command?

1075


How do you start single user mode in clustered installations?

980


Which is better statement or preparedstatement?

979