zoukankan
html css js c++ java
创建一个存储过程,查询在校生
一直都是临时写语句,现在一次性建立存储过程,日后直接调用就好。
create
procedure
sp_zaixiao
as
declare
@curyear
int
declare
@curmonth
int
declare
@tolrow
int
declare
@strsql
varchar
(
200
)
set
@curyear
=
year
(
getdate
())
set
@curmonth
=
month
(
getdate
())
if
@curmonth
>
7
select
case
when
dwdm
=
'
4420000
'
then
'
校本部
'
else
'
分校
'
end
as
'
单位
'
,
count
(xh)
as
'
人数
'
from
xsjbdab
where
xjztdm
=
'
1
'
and
nj
>
(
@curyear
-
3
)
and
xslbdm
<>
'
61
'
group
by
(
case
when
dwdm
=
'
4420000
'
then
'
校本部
'
else
'
分校
'
end
)
else
select
case
when
dwdm
=
'
4420000
'
then
'
校本部
'
else
'
分校
'
end
as
'
单位
'
,
count
(xh)
as
'
人数
'
from
xsjbdab
where
xjztdm
=
'
1
'
and
xslbdm
<>
'
61
'
and
( nj
>
(
@curyear
-
3
)
or
(nj
=
(
@curyear
-
3
)
and
zsjj
=
'
3
'
))
group
by
(
case
when
dwdm
=
'
4420000
'
then
'
校本部
'
else
'
分校
'
end
)
查看全文
相关阅读:
Apache-Shiro分布式环境配置(与redis集成)(转)
springboot整合mybatis将sql打印到日志(转)
springboot中logback打印日志(转)
Spring Boot Junit单元测试
玩转Spring Boot 自定义配置、导入XML配置与外部化配置
Windows开机自启动位置
木马开机启动的六种方法(记录)
用Delphi开发视频聊天软件
Delphi用Socket API实现路由追踪
前端工程师应该都了解的16个最受欢迎的CSS框架
原文地址:https://www.cnblogs.com/samsonleung/p/1239809.html
最新文章
char* 和char[]的差别
UDP编程
数据集成之主数据管理(一)基础概念篇
概率图模型(PGM)学习笔记(二)贝叶斯网络-语义学与因子分解
解读Unity中的CG编写Shader系列1——初识CG
linux知识点
java实现第四届蓝桥杯阶乘位数
java实现第四届蓝桥杯马虎的算式
java实现第四届蓝桥杯马虎的算式
java实现第四届蓝桥杯马虎的算式
热门文章
java实现第四届蓝桥杯马虎的算式
java实现第四届蓝桥杯马虎的算式
java实现第四届蓝桥杯猜年龄
java实现第四届蓝桥杯组素数
java实现第四届蓝桥杯组素数
java实现第四届蓝桥杯猜年龄
IntelliJ IDEA 中如何查看一个类的所有继承关系(当前类的所有继承关系图)
Spring Boot + Redis 实现Shiro集群
SpringBoot整合mybatis、shiro、redis实现基于数据库的细粒度动态权限管理系统实例(转)
Spring Data操作Redis时,发现key值出现 xacxedx00x05tx00 b
Copyright © 2011-2022 走看看