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
相关问答:
....接到一个小程序..工作原来大概是这样的...前台是WEB服务器.架构就是ASP+SQL..前台由ASP向SQL添加服务类别(表单).然后又后台程序读取表单..要实时读取..然后显示在服务器上面..从理论上面能行通不?如果可以..后台 ......
我想查出
month
1
2
3
4
5
6
7
8
9
10
11
12
这样的数据,如何实现啊。。。
SQL code:
select top 12 month=identity(int,1,1) into #t from sysobjects
selec ......
表1:
col1 col2
a a.1
b b.1
......
各位大侠,有个问题请教,我现在有两张表A,B字段都有num,如
A B
num   ......
因为是多客户端操作的,所以希望在更新的时候,可以把表用排他锁锁住,其他用户不可以查询和修改
之前看到相关问题里面提到 WITH (XLOCK) ,我这里可以用这个吗?
WITH (XLOCK) 用完之 ......