select identity(int,1,1) as a_id, a.col,a.col2,a.col3,a.col4,a.col5 into #myTable from yourTable select * from #myTable where a_id= drop table #myTable 要得到某一行的话,至少要有个标识符或别限定条件,
判断ID就行了,读的时候传入ID值,只读出比传入ID大的记录就行了.
一个笨办法,但效率较低: select min(id) from you_table where id > curr_id(目前的ID)
如果要重新使ID连续,只需要删除此字段,再重建就行了.alter table 表 drop column id alter table 表 add id int identity(1,1)如果只是想得到第XX行记录,就用: select * from 表 where id=(select id from 表 group by id having count(*)=行数)--或: select top 1 * from(select top 行数 * from 表) order by id desc
a.col,a.col2,a.col3,a.col4,a.col5 into #myTable
from yourTable
select * from #myTable where a_id=
drop table #myTable
要得到某一行的话,至少要有个标识符或别限定条件,
alter table 表 add id int identity(1,1)如果只是想得到第XX行记录,就用:
select * from 表 where id=(select id from 表 group by id having count(*)=行数)--或:
select top 1 * from(select top 行数 * from 表) order by id desc
查询第X页,每页Y条记录
http://expert.csdn.net/Expert/topic/2365/2365596.xml?temp=.8557245