IT Questions and Answers :)

Thursday, January 23, 2020

In T-SQL, which of the following is the purpose of the 'WITH' statement?

In T-SQL, which of the following is the purpose of the 'WITH' statement?

  • Create a Common Table Expression
  • Create a derived table
  • Specify filter criteria
  • Join more than two tables 

In T-SQL, which of the following is the purpose of the 'WITH' statement?

EXPLANATION

'WITH' allows you to define a Common Table Expression (a derived table that is referenced and can be referred to multiple times within a query). 'WHERE' would usually be used to specify a filter. A derived table would be written as part of the query and can only be referenced in that instance.
'JOIN' would be used to join tables together regardless of how many.
See: https://msdn.microsoft.com/en-us/library/ms175972.aspx for more details.

SOURCE

https://docs.microsoft.com/en-us/sql/t-sql/queries/with-common-table-expression-transact-sql
Share:

0 comments:

Post a Comment

Popular Posts