In sql2005, you can use row_number to obtain row n data in a table without a primary key, but you must specify the sorting column, otherwise, you have to use select into to transition to a temporary table and add a sorting field.
Use the fetch absolute statement of the cursor to obtain the data of a row under the absolute number of rows. The test code is as follows:
Set nocount on -- create a test environment and insert data, and the table does not have the primary key create table test (ID int, name varchar (10) insert into test select 999, 'jinjazz' insert into test select 888, 'csdn 'insert into test select 999, 'sqlserver' -- Obtain the absolute number of rows through the cursor declare mycursor scroll cursor for select * From testopen mycursorfetch absolute 3 from mycursor close mycursordeallocate mycursor -- delete test environment drop table testset nocount off/* -- ID ----------- ---------- 999 sqlserver --*/