sql 语句 测试了下 没什么问题
insert into sys_t_system备份 select top 1 * from sys_t_system where
第一个字段 not in (select top 149 第一个字段 from sys_t_system )
149的意思是 取得的记录不在 149条内
1的意思是 取得几条记录
比如 你想取得 第151 到 160
insert into sys_t_system备份 select top 10 * from sys_t_system where
第一个字段 not in (select top 150 第一个字段 from sys_t_system )
oracle写法:
insert into sys_t_system备份(field1,field2,...) select value1,value2,... from (select rownum no,value1,value2,... from sys_t_system where rownum<=150) where no>149;
sql server 用top.
select id=identity(int,1,1),* into temptable from A
INSERT INTO B (SELECT * FROM temptable where id =150)
drop table temptable
开始没看见需要第150行...
select * from (select *,identity(int) as nid from sys_t_system ) tb where nid between 150 to 150
选择150条
set @rownum=0
insert into A values(select @rownum:=@rownum+1 as rownum, * from B where rownum=150)
获取行号的方法:http://hi.baidu.com/%CE%D2%BA%DC%B0%AE%D5%C5%B2%AE%C2%D7/blog/item/4e176c118721e5f6c3ce79be.html