显示第n行到第m行的记录:
1.你的表中如果有id(即自动编号的字段),或字段值不重复的字段,可以用:select top m-n+1 * from tbname where id not in(select top n-1 id from tbname)2.如果没有的话,就用
select id= identity(int,1,1),* into #temp from tbname 
select * from #temp where id between m and n

解决方案 »

  1.   

    如果只想显示一行,就用:
    1.你的表中如果有id(即自动编号的字段),或字段值不重复的字段,可以用:select top 1 * from tbname where id not in(select top n-1 id from tbname)2.如果没有的话,就用
    select id= identity(int,1,1),* into #temp from tbname 
    select top 1 * from #temp where id between m and n
      

  2.   

    select IDENTITY(int, 1,1) AS ID_Num,* into #temp from 表
    select * from #temp where ID_Num=10
      

  3.   

    1. select IDENTITY(int, 1,1) AS ID_Num,* into #temp from 表
    select * from #temp where ID_Num=n
    2. select IDENTITY(int, 1,1) AS ID_Num,* into #temp from 表
    select * from #temp where ID_Num between n and m
      

  4.   

    1. select IDENTITY(int, 1,1) AS ID,* into #temp from  yourtable
    (1)select * from #temp where ID=n
    (2)select * from #temp where ID between n and m
      

  5.   

    Thanks hjb001,Give me fen.