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
相关问答:
两种错误:
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: ......
data a b c d e tag
2009-11-01 11 ......
因为是多客户端操作的,所以希望在更新的时候,可以把表用排他锁锁住,其他用户不可以查询和修改
之前看到相关问题里面提到 WITH (XLOCK) ,我这里可以用这个吗?
WITH (XLOCK) 用完之 ......
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 ......