Data Modification
issue the modification statement against the table expression.
For example, the following code deletes the 50 orders with the lowest order ID values rather than
just any 50 rows.
WITH C AS
(
SELECT TOP(50) *
ORDER BY orderid
)
DELETE FROM C;
their freight values by 10.
ORDER BY orderid DESC
UPDATE C
In SQL Server 2012, you can use the OFFSET-FETCH option instead of TOP in the inner SELECT
queries. Here’s the revised DELETE example.
SELECT *
OFFSET 0 ROWS FETCH FIRST 50 ROWS ONLY
www.it-ebooks.info
Microsoft SQL Server 2012 T-SQL Fundamentals