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
as
set rowcount 10
select name,tim,counter
from (select top 15 * from down order by tim desc) A
order by tim
调试欢乐多
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
只取前15条。
以下同。
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
as
select top 10 name,tim,counter
from (select top 15 * from down order by tim desc) A
order by tim
as
select top 10 name,tim,counter from down where tim not in (select top 5 tim from down) order by tim
to: yujohny(踏网无痕)
为什么有的人喜欢用CREATE,而有的人喜欢用ALTER