--Paging data----row_number () is called window-opening function, can be paged operation
Select Row_number () over (order by ID) as Num,*from gb_data----adds a sequential num value to each column to facilitate the use of the first few data.
Select row_number () over (order by ID) as num,* from Gb_data where Num>5and num< 10--This line of code is wrong, because the system does not recognize how much num is, why?
-Because of the order of execution, the SQL statement executes the from, then executes where, and finally executes the Select
--the correct wording is as follows
Select * FROM (select row_number () over (order by ID) as num,*from where t.num>5and t.num<
--Sub-query (query table as a condition, on the basis of a second inquiry) query all the books published in the Year of the membership of the reader information
Select*fromwhere(select from book)
The function that generates the GUID in Guid:server is newid ()
INSERT into t_table (ID) VALUES (NEWID ())
Collation of common SQL statements--sql Server 2008 (query three-subquery) and GUID