如何获取指定的第几条记录
例:
name    info
l       TTT
M       FFF
DD      RRR
K       SSS
T       FFS输入1 获得  
l       TTT
输入3 获得
DD      RRR
输入5 获得
T       FFS
如何用一条sql语句实现 ,获取某条指定的纪录

解决方案 »

  1.   

    name    info
    l       TTT
    M       FFF
    DD      RRR
    K       SSS
    T       FFS
    ------------------------------
    alter table t
    add id int identity(1,1)select * from t where id=1
      

  2.   

    select id=identity(int , 1,1) ,* into temp from tbselect * from id = 1 --(or id = 3 or id =5)
      

  3.   

    如果能用存储过程就好了,只能使用sql 语句
      

  4.   

    select id=identity(int , 1,1),t.* into #a from table as tselect * from #a where ........
      

  5.   

    如果能用存储过程就好了,只能使用sql 语句------------
    你希望用存储过程嗎?create proc aa (@id int)
    as
    select * from t where id=@idexec aa 1