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
)
查看全文
相关阅读:
单例模式-Singlleton
C#中静态与非静态方法比较
关于orcale的数据库脚本,记录下来,方便自己以后用到查找
关于Oracle和SQLServer数据库在.net中拼接数据库语句的不同
Oracle数据类型与.NET中的对应关系
Got a packet bigger than 'max_allowed_packet' bytes
.NET、C#和ASP.NET三者之间的区别(转)
The use specified as definer('root'@'%') does not exist的解决办法
app.config .exe.config .vshost.exe.config配置
python学习:(3)自动化表单提交
原文地址:https://www.cnblogs.com/samsonleung/p/1239809.html
最新文章
堆调试技巧
CVE-2017-11882 简单分析
Heap Spray:堆与栈的协同攻击
CVE-2010-2883_Adobe_cooltype_sing
Cuckoo WIndows 安装
对称加密算法——RC4
x86/x64 Call Jmp 指令区别
Windows 自启动总结《转》
Debug Hook
又抽抽了,开始胡思乱想 2
热门文章
又抽抽了,开始胡思乱想
【转】驱动推荐书籍
周一 , 一个新的开始
派遣函数IRP
加载驱动的相关函数
编写驱动的常用函数
关于FastIo
WindowsNT设备驱动程序开发基础
驱动开发的一些基本概念
简单工厂模式-Simple Factory Pattern
Copyright © 2011-2022 走看看