Escolar Documentos
Profissional Documentos
Cultura Documentos
and Grouping
06 | Modifying Data
INSERT, UPDATE, and DELETE statements, use of defaults, constraints, and triggers, OUTPUT
Using T-SQL programming elements, implementing error handling, understanding and implementing transactions
Querying system catalogs and dynamic management views, creating and executing stored procedures, improving SQL
Server query performance
<SELECT query_1>
<set_operator>
<SELECT query_2>
[ORDER BY <sort_list>]
Purchasing
Sales
Purchasing
Sales
INTERSECT
Purchasing
Sales
Sales
Purchasing
1.
2.
SELECT <column_list>
FROM
<left_table> AS <alias>
CROSS/OUTER APPLY
<derived_table_expression or inline_TVF> AS <alias>
OrderDate
-------------------------2007-08-01 00:00:00.000
2007-10-01 00:00:00.000
2006-09-01 00:00:00.000
2007-08-01 00:00:00.000
2006-11-01 00:00:00.000
2007-04-01 00:00:00.000
TotalDue TotalDueByCust
-------- -------------3756.989
9115.1341
2587.8769 9115.1341
2770.2682 9115.1341
2674.0227 7054.1875
3729.364
7054.1875
650.8008 7054.1875
Function
Description
RANK
DENSE_RANK
ROW_NUMBER
NTILE
Function
Description
LAG
LEAD
FIRST_VALUE
LAST_VALUE
Pivoted data
5
4
4
4
5
5
4
5
<SELECT query_1>
<set_operator>
<SELECT query_2>
[ORDER BY <sort_list>]
2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in
the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because
Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information
provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.