请将这个简单的存储过程改一下!

netvsj2ee 2003-10-20 02:43:28
ALTER proc upSoftWare
as
set rowcount 10
select name,tim,counter from down order by tim
使它从第五条记录开始显示10条记录
谢谢大家,请帮忙!
...全文
30 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
netvsj2ee 2003-10-20
  • 打赏
  • 举报
回复
这里的热心朋友太多了,我要慢慢看看,谢谢大家
to: yujohny(踏网无痕)
为什么有的人喜欢用CREATE,而有的人喜欢用ALTER
whaisheng 2003-10-20
  • 打赏
  • 举报
回复
alter 修改存儲過程.
yujohny 2003-10-20
  • 打赏
  • 举报
回复
CREATE是建立,ALTER是修改
Dennis618 2003-10-20
  • 打赏
  • 举报
回复
ALTER proc upSoftWare
as
select top 10 name,tim,counter from down where tim not in (select top 5 tim from down) order by tim
yujohny 2003-10-20
  • 打赏
  • 举报
回复
ALTER proc upSoftWare
as
select top 10 name,tim,counter
from (select top 15 * from down order by tim desc) A
order by tim
axiaowin 2003-10-20
  • 打赏
  • 举报
回复
ALTER proc upSoftWare中的ALTER是什么意思?不是都用CREATE的吗?
aierong 2003-10-20
  • 打赏
  • 举报
回复
ALTER proc upSoftWare
as
if object_id('tempdb..#tem') is not null
drop table #tem
select identity(int,1,1) ids,name,tim,counter into #tem
from down
order by tim
select name,tim,counter
from #tem
where ids between 5 and 14
银狐被占用 2003-10-20
  • 打赏
  • 举报
回复
同意sdhdy(大江东去...)

但是得改进。
只取前15条。
以下同。
sdhdy 2003-10-20
  • 打赏
  • 举报
回复
ALTER proc upSoftWare
as

--表里没有自增字段,才可以如下
select identity(int,1,1) FID,* into #temp from tablename
go
select * from #temp where FID between 5 and 15
go
drop table #temp
yujohny 2003-10-20
  • 打赏
  • 举报
回复
ALTER proc upSoftWare
as
set rowcount 10
select name,tim,counter
from (select top 15 * from down order by tim desc) A
order by tim

34,575

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧