将表table中的序号字段(int型)修改为该记录的行数的存储过程怎么写?即该记录为第三行则该记录的序号字段为3。 declear ttt intset ttt = select count(*) from 表for i:=1 to tttbegin table.序号=i; table.update;end; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 declare @i intset @i=0update 表 set @i=@i+1,序号=@i declear @ttt intset @ttt = select count(*) from 表for i:=1 to tttbegin table.序号=i; table.update;end; declare @i intset @i=0update 表 set 序号=@i=@i+1 declare @i intset @i=0update 表 set @i=序号,序号=@i+1 结了贴也有一个话题:to:netcoder(数据猪)你为什么说表中的记录是没有上下之分的,如果如你所说,那么我用select identity(int 1,1),* into #table from table结果有会如何呢? agent服务启动不来 储存过程报错,那位仁兄帮助看看。 !!!!!!!!!!!!!很难的一句sql语句,总是超时,怎么解决? 不要用游标! Sql查询问题,高手进!!(解决后立即给分) 如何把一行里的数据------------变成多行? 表清除重复,第二次请教, SQL排序问题,请求高人解答 SQL SERVER2000 变慢 从sql 7.0 直接升级到2000后,DTS包总是莫名其妙的出错 简单问题:日期的显示格式 怎么我的SOL-SERVER2000服务管理器报这样的错误~
set @i=0
update 表 set @i=@i+1,序号=@i
for i:=1 to ttt
begin
table.序号=i;
table.update;
end;
set @i=0
update 表 set 序号=@i=@i+1
set @i=0
update 表 set @i=序号,序号=@i+1
to:netcoder(数据猪)
你为什么说表中的记录是没有上下之分的,
如果如你所说,那么我用
select identity(int 1,1),* into #table from table
结果有会如何呢?