您好,欢迎来到爱问旅游网。
搜索
您的当前位置:首页SQL编程:统计n次考试的成绩

SQL编程:统计n次考试的成绩

来源:爱问旅游网

USE [new_wzjw] GO /****** Object: StoredProcedure [dbo].[成绩管理_过程化成绩录入_统计最终成绩] Script Date: 2014/4/1 19:22:01 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER proc [dbo].[成绩管理_过程化成绩录入_统计最终成绩]

USE [new_wzjw]

GO

/****** Object: StoredProcedure [dbo].[成绩管理_过程化成绩录入_统计最终成绩] Script Date: 2014/4/1 19:22:01 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

ALTER proc [dbo].[成绩管理_过程化成绩录入_统计最终成绩]

@kcid jxrw_code

as begin

declare c1 cursor for

select zzcj.cj,zzcj.xh from

(select xh from web_inputCj_cjb where kcId=@kcid)xsxx

left join

(select xh,round(sum(cjbl*0.01*isnull(cj,0)),0)cj from web_inputCj_xscjb xscjb left join

(select ksid,cjbl from web_inputCj_xsksb where kcId=@kcid)ksxx

on xscjb.ksid=ksxx.ksid group by xh

)zzcj on zzcj.xh=xsxx.xh

declare @cj float

declare @xh varchar(12)

open c1

fetch c1 into @cj,@xh

while @@FETCH_STATUS = 0

begin

update web_inputCj_cjb set cj=@cj where xh=@xh and kcId=@kcId

fetch c1 into @cj,@xh end

end

Copyright © 2019- awee.cn 版权所有 湘ICP备2023022495号-5

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务