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
)
查看全文
相关阅读:
tempfile 模块
gc 模块
hashlib 加密模块
optparse模块
ios网络相关问题-HTTPS与网络安全
Charles抓包原理
ios网络相关问题-HTTP特点
ios网络相关问题-HTTP协议
React-Native package.json、node_modules等文件说明
Swift 4.0 中的 open,public,internal,fileprivate,private
原文地址:https://www.cnblogs.com/samsonleung/p/1239809.html
最新文章
linux centos 添加环境变量
移动端点击出现阴影 css解决方案
git的https方式记住用户名和密码
Javascript一句话数组降维
仿锤子手机官网banner幻灯效果 Jquery插件
js获取网页正文
webstorm code
javascript fn.init 原型链练习
safari iframe 宽度不受控制解决
javascript 数组随机排序 洗牌算法
热门文章
我为什么要写博客?
ZooKeeper的使用:安装、常用的命令
Mac下 javac java 进行编译和运行含有包路径及引入jar包的类
初识redis——mac下搭建redis环境
struct 模块
Queue模块
threading 模块
traceback 异常跟踪
traceback 异常跟踪
shutil 模块
Copyright © 2011-2022 走看看