惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - 张锋

[GDI+]如何制作出高质量的缩略图 Soap 结构初识 WebCom.Net [GDI+]如何将一个彩色图像转换成黑白图像 [GDI+] 创建Images的两种方式 操作Oracle数据库实现上传图片到Blob类型的字段 如何防止同一帐户重复登录系统 世界杀毒软件排名 Scroll Page Class 解决定位问题 struct和class的区别 - 张锋 - 博客园 B/S系统中如何定位到对象 学习游戏开发经典网站 Url2Ip - 张锋 - 博客园 BLOG程序 IE功能汇总 WEB打印的相关技术分析 Blog RSS Reader 资料整理 - 张锋 Oracle常用的一些功能集锦 XML Server与XML-enabled Web Server介绍
对于想这种频繁的视图如何看待
张锋 · 2004-06-30 · via 博客园 - 张锋

由于要做某个模块,想拿来先前同事写的视图代码一用,可是那来后我才发觉是这样子的

create view zc_ypz as
select zcgs,dwdm,zysx,hj,1 as kpml,sum(yzje) as aa,0 as bb,0 as cc,0 as dd from zc_skpk
where zcgs=1 and zysx<>10 and zysx<>7 and (mlbh like '100%' or mlbh like '110%') and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs,dwdm,zysx,hj,2 as kpml,sum(yzje) as aa,0 as bb,0 as cc,0 as dd from zc_skpk
where zcgs=1 and zysx<>10 and zysx<>7 and (mlbh like '010%' or mlbh like '030%') and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,3 as kpml,sum(yzje) as aa,0 as bb,0 as cc,0 as dd from zc_skpk
where zcgs=1 and zysx<>10 and zysx<>7 and mlbh like '040%' and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,4 as kpml,sum(yzje) as aa,0 as bb,0 as cc,0 as dd from zc_skpk
where zcgs=1 and zysx<>10 and zysx<>7 and mlbh like '05001%' and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,5 as kpml,sum(yzje) as aa,0 as bb,0 as cc,0 as dd from zc_skpk
where zcgs=1 and zysx<>10 and zysx<>7 and (mlbh not like '100%' and mlbh not like '110%' and mlbh
not like '010%' and mlbh not like '030%' and mlbh not like '040%' and mlbh not like '05001%') and
mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,1 as kpml,0 as aa,sum(yzje) as bb,0 as cc,0 as dd from zc_skpk
where zcgs=2 and zysx<>10 and zysx<>7 and (mlbh like '100%' or mlbh like '110%') and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,2 as kpml,0 as aa,sum(yzje) as bb,0 as cc,0 as dd from zc_skpk
where zcgs=2 and zysx<>10 and zysx<>7 and (mlbh like '010%' or mlbh like '030%') and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,3 as kpml,0 as aa,sum(yzje) as bb,0 as cc,0 as dd from zc_skpk
where zcgs=2 and zysx<>10 and zysx<>7 and mlbh like '040%' and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,4 as kpml,0 as aa,sum(yzje) as bb,0 as cc,0 as dd from zc_skpk
where zcgs=2 and zysx<>10 and zysx<>7 and mlbh like '05001%' and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,5 as kpml,0 as aa,sum(yzje) as bb,0 as cc,0 as dd from zc_skpk
where zcgs=2 and zysx<>10 and zysx<>7 and (mlbh not like '100%' and mlbh not like '110%' and mlbh
not like '010%' and mlbh not like '030%' and mlbh not like '040%' and mlbh not like '05001%') and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,1 as kpml,0 as aa,0 as bb,sum(yzje) as cc,0 as dd from zc_skpk
where zcgs=3 and zysx<>10 and zysx<>7 and (mlbh like '100%' or mlbh like '110%') and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,2 as kpml,0 as aa,0 as bb,sum(yzje) as cc,0 as dd from zc_skpk
where zcgs=3 and zysx<>10 and zysx<>7 and (mlbh like '010%' or mlbh like '030%') and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,3 as kpml,0 as aa,0 as bb,sum(yzje) as cc,0 as dd from zc_skpk
where zcgs=3 and zysx<>10 and zysx<>7 and mlbh like '040%' and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,4 as kpml,0 as aa,0 as bb,sum(yzje) as cc,0 as dd from zc_skpk
where zcgs=3 and zysx<>10 and zysx<>7 and mlbh like '05001%' and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,5 as kpml,0 as aa,0 as bb,sum(yzje) as cc,0 as dd from zc_skpk
where zcgs=3 and zysx<>10 and zysx<>7 and (mlbh not like '100%' and mlbh not like '110%' and mlbh
not like '010%' and mlbh not like '030%' and mlbh not like '040%' and mlbh not like '05001%') and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,1 as kpml,0 as aa,0 as bb,0 as cc,sum(yzje) as dd from zc_skpk
where zcgs=4 and zysx<>10 and zysx<>7 and (mlbh like '100%' or mlbh like '110%') and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,2 as kpml,0 as aa,0 as bb,0 as cc,sum(yzje) as dd from zc_skpk
where zcgs=4 and zysx<>10 and zysx<>7 and (mlbh like '010%' or mlbh like '030%') and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,3 as kpml,0 as aa,0 as bb,0 as cc,sum(yzje) as dd from zc_skpk
where zcgs=4 and zysx<>10 and zysx<>7 and mlbh like '040%' and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,4 as kpml,0 as aa,0 as bb,0 as cc,sum(yzje) as dd from zc_skpk
where zcgs=4 and zysx<>10 and zysx<>7 and mlbh like '05001%' and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,5 as kpml,0 as aa,0 as bb,0 as cc,sum(yzje) as dd from zc_skpk
where zcgs=4 and zysx<>10 and zysx<>7 and (mlbh not like '100%' and mlbh not like '110%' and mlbh
not like '010%' and mlbh not like '030%' and mlbh not like '040%' and mlbh not like '05001%') and mlbh not like '120%' group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,0 as kpml,sum(yzje) as aa,0 as bb,0 as cc,0 as dd from zc_skpk where
zcgs=1 and zysx=10 group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,0 as kpml,0 as aa,sum(yzje) as bb,0 as cc,0 as dd from zc_skpk where
zcgs=2 and zysx=10 group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,0 as kpml,0 as aa,0 as bb,sum(yzje) as cc,0 as dd from zc_skpk where
zcgs=3 and zysx=10 group by dwdm,zysx,hj,zcgs
union
select zcgs, dwdm,zysx,hj,0 as kpml,0 as aa,0 as bb,0 as cc,sum(yzje) as dd from zc_skpk where
zcgs=4 and zysx=10 group by dwdm,zysx,hj,zcgs
union
select b.zcgs, b.dwdm,a.zylxbh as zysx,b.hj,1 as kpml,sum(a.ZYLX_JE) as aa,0 as bb,0 as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=1 and a.zylxbh<>10 and (b.mlbh like '100%' or b.mlbh like '110%') and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,2 as kpml,sum(a.ZYLX_JE) as aa,0 as bb,0 as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=1 and a.zylxbh<>10 and (b.mlbh like '010%' or b.mlbh like '030%') and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,3 as kpml,sum(a.ZYLX_JE) as aa,0 as bb,0 as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=1 and a.zylxbh<>10 and b.mlbh like '040%' and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,4 as kpml,sum(a.ZYLX_JE) as aa,0 as bb,0 as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=1 and a.zylxbh<>10 and b.mlbh like '05001%' and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,5 as kpml,sum(a.ZYLX_JE) as aa,0 as bb,0 as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=1 and a.zylxbh<>10 and (b.mlbh not like '100%' and b.mlbh not like '110%' and b.mlbh not
like '010%' and b.mlbh not like '030%' and b.mlbh not like '040%' and b.mlbh not like '05001%')
and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,1 as kpml,0 as aa,sum(a.ZYLX_JE) as bb,0 as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=2 and a.zylxbh<>10 and (b.mlbh like '100%' or b.mlbh like '110%') and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,2 as kpml,0 as aa,sum(a.ZYLX_JE) as bb,0 as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=2 and a.zylxbh<>10 and (b.mlbh like '010%' or b.mlbh like '030%') and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,3 as kpml,0 as aa,sum(a.ZYLX_JE) as bb,0 as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=2 and a.zylxbh<>10 and b.mlbh like '040%' and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,4 as kpml,0 as aa,sum(a.ZYLX_JE) as bb,0 as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=2 and a.zylxbh<>10 and b.mlbh like '05001%' and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,5 as kpml,0 as aa,sum(a.ZYLX_JE) as bb,0 as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=2 and a.zylxbh<>10 and (b.mlbh not like '100%' and b.mlbh not like '110%' and b.mlbh not
like '010%' and b.mlbh not like '030%' and b.mlbh not like '040%' and b.mlbh not like '05001%')
and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,1 as kpml,0 as aa,0 as bb,sum(a.ZYLX_JE) as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=3 and a.zylxbh<>10 and (b.mlbh like '100%' or b.mlbh like '110%') and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,2 as kpml,0 as aa,0 as bb,sum(a.ZYLX_JE) as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=3 and a.zylxbh<>10 and (b.mlbh like '010%' or b.mlbh like '030%') and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,3 as kpml,0 as aa,0 as bb,sum(a.ZYLX_JE) as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=3 and a.zylxbh<>10 and b.mlbh like '040%' and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,4 as kpml,0 as aa,0 as bb,sum(a.ZYLX_JE) as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=3 and a.zylxbh<>10 and b.mlbh like '05001%' and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,5 as kpml,0 as aa,0 as bb,sum(a.ZYLX_JE) as
cc,0 as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and
b.zcgs=3 and a.zylxbh<>10 and (b.mlbh not like '100%' and b.mlbh not like '110%' and b.mlbh not
like '010%' and b.mlbh not like '030%' and b.mlbh not like '040%' and b.mlbh not like '05001%')
and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,1 as kpml,0 as aa,
0 as bb,0 as cc,sum(a.ZYLX_JE) as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and
a.dwbh=b.dwdm and b.zysx=7 and b.zcgs=4 and a.zylxbh<>10 and (b.mlbh like '100%' or b.mlbh like
'110%') and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,2 as kpml,0 as aa,0 as bb,0 as cc,sum
(a.ZYLX_JE) as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7
and b.zcgs=4 and a.zylxbh<>10 and (b.mlbh like '010%' or b.mlbh like '030%') and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,3 as kpml,0 as aa,0 as bb,0 as cc,sum
(a.ZYLX_JE) as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7
and b.zcgs=4 and a.zylxbh<>10 and b.mlbh like '040%' and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,4 as kpml,0 as aa,0 as bb,0 as cc,sum
(a.ZYLX_JE) as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7
and b.zcgs=4 and a.zylxbh<>10 and b.mlbh like '05001%' and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,5 as kpml,0 as aa,0 as bb,0 as cc,sum
(a.ZYLX_JE) as dd from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7
and b.zcgs=4 and a.zylxbh<>10 and (b.mlbh not like '100%' and b.mlbh not like '110%' and b.mlbh not like '010%' and b.mlbh not like '030%' and b.mlbh not like '040%' and b.mlbh not like '05001%') and mlbh not like '120%' group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,0 as kpml,sum(a.ZYLX_JE) as aa,0 as bb,0 as cc,0 as dd
from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and b.zcgs=1 and
a.zylxbh=10 group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,0 as kpml,0 as aa,sum(a.ZYLX_JE) as bb,0 as cc,0 as dd
from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and b.zcgs=2 and
a.zylxbh=10 group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,0 as kpml,0 as aa,0 as bb,sum(a.ZYLX_JE) as cc,0 as dd
from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and b.zcgs=3 and
a.zylxbh=10 group by b.dwdm,a.zylxbh,b.hj,b.zcgs
union
select b.zcgs,b.dwdm,a.zylxbh as zysx,b.hj,0 as kpml,0 as aa,0 as bb,0 as cc,sum(a.ZYLX_JE) as dd
from zc_kpzylx a,zc_skpk b where a.kpbh=b.kpbh and a.dwbh=b.dwdm and b.zysx=7 and b.zcgs=4 and
a.zylxbh=10 group by b.dwdm,a.zylxbh,b.hj,b.zcgs;