将一个表21~30删除,sql语句怎么写

解决方案 »

  1.   

    21-30是什么意思?字段的话就delete from table1 where col1>=21 and col1<=30
    指的是第几条记录的话
    delete from table1 where rowid in 
      (select rd from (
        select rowid rd,rownum rn from table1)
      where rn>=21 and rn<=30)
      

  2.   

    delete from table1 where rn in 
      (
        select rn 
            from 
            ( 
               select row_number() over(partition by ??(你要排序的字段) rn order by rowid 
                from table1
             ) 
            where rn>=21 and rn <=30
      )