一般用top n,或者指定idselect identity(int,1,1) as id,*
into #table
from tableselect * from #table where id=...

解决方案 »

  1.   

    select top 1 * from table
      

  2.   

    select top 1 * from table order by id
      

  3.   

    select top 1 * from table order by id
      

  4.   

    SELECT 字段名 FROM 表名
    WHERE 字段名=???
      

  5.   

    select top 1 * from table order by id
    有这样的写法的阿
      

  6.   

    select top 1 * from table order by id
      

  7.   

    --随机取一条
    select top 1 * from table order by newid()
      

  8.   

    如果该表有主键:select * from tablename where 主键=xxxx如果该表没有主键,并且随意选择:select top 1 * from tablename order by newid()如果该表没有主键,但是想选择确定记录:alter table tablename add [id] int identity(1,1)
    go
    select * from tablename where [id]=xxxx
      

  9.   

    select top 1  * from table_name 是一样的