Oracle创建视图(View)实例

更新时间:2023-07-02 19:29:27 阅读: 评论:0

Oracle创建视图(View)实例
语法:
create or replace【ViewName】as
lect * from QueryTable[s]
实例:
create or replace view vm_wo as
lect'2'as sources,wo_nbr,wo_lot,wo_cust,wo_part,wo_rel_date,wo_due_date,wo_qty_ord,wo_status,wo_line,wo_so_nbr,wo_so_line, wo_soft,wo_soft_ver,wo_rmks,wo_mod_date,
(ca when wop_ptsize like'%LED%TV%'then nvl(wopd1_capacity_ratio,0)
when wop_ptsize like'%LED%PANEL%'then nvl(wopd2_capacity_ratio,0)
el0end) wo_standard_ratio,
round(decode(nvl(t.wo_rel_hour,0),0,0,(ca when wop_ptsize like'%LED%TV%'then nvl(wopd1_capacity_ratio,0) when wop_ptsize like'%LED%PANEL%'then nvl(wopd2_capacity_ratio,0)
el0end) * wo_qty_comp / t.wo_rel_hour),4) wo_standard_efficient,俄国的改革
nvl(wo_std_pl,0) wo_standard_person,
round(nvl(wo_man_haur,0),4) wo_standard_time
from wo_mstr
join pt_mstr on pt_part = wo_part
join wop1_mstr on pt_size = wop_ptsize
left join wopd1_det on wopd1_nbr = wop_nbr and pt_cmt = wopd1_capacity_type
男人必看的电影>分时线
left join wopd2_det on wopd2_nbr = wop_nbr and pt_group = wopd2_capacity_type
xxx26left join (
lect pzd_wo_nbr,pzd_wo_lot, nvl(sum(pzd_people_count*pzd_rel_hour),0) wo_rel_hour
from pzd_det a  join pz_mstr b on pz_nbr = pzd_nbr
group by pzd_wo_nbr,pzd_wo_lot
) t on t.pzd_wo_nbr = wo_nbr and t.pzd_wo_lot = wo_lot
where1=1
and trunc(sysdate,'dd') between wop_start and wop_end
union all
lect'1'as sources,wo_nbr,wo_lot,wo_cust,wo_part,wo_rel_date,wo_due_date,wo_qty_ord,wo_status,wo_line,wo_so_nbr,wo_so_line, wo_soft,wo_soft_ver,wo_rmks,wo_mod_date,
(ca when wop_ptsize like'%LED%TV%'then nvl(wopd1_capacity_ratio,0)
when wop_ptsize like'%LED%PANEL%'then nvl(wopd2_capacity_ratio,0)
el0end) wo_standard_ratio,
round(decode(nvl(t.wo_rel_hour,0),0,0,(ca when wop_ptsize like'%LED%TV%'then nvl(wopd1_capacity_ratio,0) when wop_ptsize like'%LED%PANEL%'then nvl(wopd2_capacity_ratio,0)
el0end) * wo_qty_comp / t.wo_rel_hour),4) wo_standard_efficient,
nvl(wo_std_pl,0) wo_standard_person,
round(nvl(wo_man_haur,0),4) wo_standard_time
回车换行符from (lect wo_nbr,wo_lot,wo_cust,wo_part,wo_rel_date,wo_due_date,wo_qty_ord,wo_status,wo_line,wo_so_nbr,wo_so_line,
wo_soft,wo_soft_ver,wo_rmks,wo_mod_date,wo_std_pl,wo_man_haur,wo_qty_comp from huinan.wo_mstr@huinanerp)清水油面筋
join huinan.pt_mstr@huinanerp on pt_part = wo_part
join huinan.wop1_mstr@huinanerp on pt_size = wop_ptsize
left join huinan.wopd1_det@huinanerp on wopd1_nbr = wop_nbr and pt_cmt = wopd1_capacity_type
left join huinan.wopd2_det@huinanerp on wopd2_nbr = wop_nbr and pt_group = wopd2_capacity_type芳老
left join (
lect pzd_wo_nbr,pzd_wo_lot, nvl(sum(pzd_people_count*pzd_rel_hour),0) wo_rel_hour剁肉
from huinan.pzd_det@huinanerp a  join huinan.pz_mstr@huinanerp b on pz_nbr = pzd_nbr
group by pzd_wo_nbr,pzd_wo_lot
) t on t.pzd_wo_nbr = wo_nbr and t.pzd_wo_lot = wo_lot
where1=1
and trunc(sysdate,'dd') between wop_start and wop_end;

本文发布于:2023-07-02 19:29:27,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/1074700.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:视图   电影   改革   清水   俄国   油面筋   男人
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图