Sql Server 如何获取指定一行数据?在没有自动增长列的情况下
--sql 2000
select * from
(
select * , number = (select count(*) from tb where id < t.id) + 1 from table t
) m where number = 你指定的数值.
--sql 2005
select * from
(
select * , number = row_number() over(order by id) from table
) m where number = 你指定的数值.
select * from
(
select * , number = (select count(*) from tb where id < t.id) + 1 from table t
) m where number = 你指定的数值.
--sql 2005
select * from
(
select * , number = row_number() over(order by id) from table
) m where number = 你指定的数值.