欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

informix的view创建有关问题

更新时间: 2014-01-05 02:20:23 责任编辑: Author_N1

 

informix的view创建问题
select   ep_general_cou.loanCardNo,ep_general_cou.loanCardNo,general_cou,register_capital_cou,admin_manager_cou,arrear_interest_cou  
from  
(select   loanCardNo,count(*)   as   general_cou   from   ep_general   where   1=1   group   by   loanCardNo   )   as   ep_general_cou  
left   join  
(select   loanCardNo,count(*)   as   register_capital_cou   from   ep_register_capital   group   by   loanCardNo)   as   ep_register_capital_cou  
on   ep_general_cou.loanCardNo=ep_register_capital_cou.loanCardNo  
left   join  
(select   loanCardNo,count(*)   as   admin_manager_cou   from   ep_admin_manager   group   by   loanCardNo)   as   ep_admin_manager_cou  
on   ep_general_cou.loanCardNo=ep_admin_manager_cou.loanCardNo  
left   join  
(select   loanCardNo,count(*)   as   arrear_interest_cou   from   ep_arrear_interest   group   by   loanCardNo)   as   ep_arrear_interest_cou  
on   ep_general_cou.loanCardNo=ep_arrear_interest_cou.loanCardNo

哪位高手能把上面的结果集建立一个view,给出view创建过程,谢谢

--参考方法--

create view 视图名 as

select ep_general_cou.loanCardNo,ep_general_cou.loanCardNo,general_cou,register_capital_cou,admin_manager_cou,arrear_interest_cou
from
(select loanCardNo,count(*) as general_cou from ep_general where 1=1 group by loanCardNo ) as ep_general_cou
left join
(select loanCardNo,count(*) as register_capital_cou from ep_register_capital group by loanCardNo) as ep_register_capital_cou
on ep_general_cou.loanCardNo=ep_register_capital_cou.loanCardNo
left join
(select loanCardNo,count(*) as admin_manager_cou from ep_admin_manager group by loanCardNo) as ep_admin_manager_cou
on ep_general_cou.loanCardNo=ep_admin_manager_cou.loanCardNo
left join
(select loanCardNo,count(*) as arrear_interest_cou from ep_arrear_interest group by loanCardNo) as ep_arrear_interest_cou
on ep_general_cou.loanCardNo=ep_arrear_interest_cou.loanCardNo
上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 02:20:23
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/8653/
本文WWW.DOC100.NET DOC100.NET版权所有。