易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL语句问题,高手帮忙!!

将一个表21~30删除,sql语句怎么写
这个太笼统了,是排序后的第21条到30条记录删除还是某一列值在21到30之间的删除啊?

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)

学习。。。



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
  )

up


相关问答:

SQL server数据集出错求助

两种错误:
1.如果我这样申明:ResultSet rs;错误提示如下:

An error occurred at line: 51 in the jsp file: /index.jsp
The local variable rs may not have been initialized
48:    ......

SQL交叉查詢

  data            a        b        c        d        e  tag
2009-11-01 11 ......

sql 如何加表的排他锁

因为是多客户端操作的,所以希望在更新的时候,可以把表用排他锁锁住,其他用户不可以查询和修改

之前看到相关问题里面提到 WITH  (XLOCK) ,我这里可以用这个吗?

WITH  (XLOCK) 用完之 ......

总会碰到怪的问题,sql问题

sql2005
select *from v_ddxx where d_sfsc='0' and (g_ssbm='1001' or g_ssbm='1002') and (xxf>0 and  xxfwzf <>0 ),执行速度慢的要死,但是如果把(xxf>0 and  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号