我的问题是这样的,我现有有一个表,我想要删除表中 的第10行 记录,这条记录是什么内容我不知道,只知道是 第十行记录。应该怎么写SQL 语句呢,假设表名 是text。

解决方案 »

  1.   


    select top 1 * from (select top 10 * from pinout) as a order by 排序字段
      

  2.   


    delete 表 where [id]=(select top 1 [id] from (select top 10 * from 表) as a order by 排序字段)
      

  3.   

    实际应用中,数据表一定要有关键字的,没关键字时加个自增列ID。delete from 表名 where id=???最简单的算法,才是最好的算法 
      

  4.   

    delete from text where id=(select top 1 id from (select top 10 * from text order by id) a order by id desc)
      

  5.   

    SELECT IDD=IDENTITY(INT,1,1),* INTO #T FROM TB 
    DELETE #T WHERE IDD=10
      

  6.   

    select top 10 * from 表 and 主键 not in ( select top 9 主键 from 表) 
    不要排序,有排序字段会有问题
      

  7.   

    delete top 1 from table where id not in(select top 9 from table order by id order by id desc) order by id asc
      

  8.   

    declare @id int
    select top 3 @id = id from NewsInfo
    delete from NewsInfo where id = @id