SQL 存储过程示例讲解
2024-10-06 12:47:25
create proc score_result
@courseName varchar(20) --参数
as
declare --定义变量
@courseNo int,
@testTime1 datetime,
@avg int
begin --方法开始
select @courseNo=courseNo from course where courseName=@courseName
select @testTime1=max(testTime) from chengji where courseNo=@courseNo;
select @avg=AVG(result) from chengji where courseNo=@courseNo
and testtime=@testTime1
select @avg --打印平均分
select * from student where studentno in (select studentNo from chengji where
courseNo=@courseNo and testTime=@testTime1 and result<60);--打印不及格的学生信息
end; --方法结束
最新文章
- HTML 学习笔记 CSS3(Animation)
- Theano2.1.16-基础知识之调试:常见的问题解答
- 调用jar程序,读取与jar同级的配置文件。
- 防止非授权用户调用DLL
- Oracle 唯一主键引发的行锁
- Lotus Sametime
- 字符集编码与Python(二)Unicode与utf-8
- [HNOI2002]营业额统计_Treap
- Scapy实现SYN泛洪攻击
- c语言实现两个单链表的交叉合并
- Ubuntu14.04打开cheese却黑屏的问题
- Confluence 6 home 修改 Home 目录的位置
- 微商城项目 请求接口封装中出现 callback &;&; callback() 原理
- Django admin 后台管理
- sublime的lua插件
- 什么时候用深搜(dfs)什么时候用广搜(bfs)(转)
- JavaWeb学习路线图
- 在html5 canvas的destination-atop属性的一些奇怪的问题
- Python3中关于下划线变量和命名的总结
- 性能测试loadrunner安装