* FROM Table id FROM Table )) --从TABLE表中取出第m到n条记录 (Exists版本) * FROM TABLE AS a WHERE Not Exists ( * From TABLE order by id) b Where b.id=a.id ) Order by id --m为上标,n为下标,例如取出第8到12条记录,m=8,n=12,Table为表名,Temp为临时表 * From Table Where Id>(Select Max(Id) From…
DECLARE @TableName varchar(); CREATE TABLE #GetRecordingTempTable([id] [INT] IDENTITY(,) NOT NULL, [TableName] varchar() NOT NULL, [RecordingCount] INT); DECLARE Table_Cursor CURSOR FOR SELECT [name] FROM sysobjects WHERE xtype='U'; OPEN Table_Cursor…