create or replace view V_$Workers as
select rnum,oper,opername,opdate,rname,rclass,rdclass,rera.raccname,rgrade,rresource,rrefnum,rwarehouserwound,workid,taskname,imgpath,werifyrecord,werifyperson,werifydate,snumber,jjudger,jdate,jrem,jopinion from(
select rnum,rclass,rgrade,rresource,rrefnum,rfillope as oper,rfillopename as opername,rfilldate as opdate
from relic where (rfillope is not null or rfillope <> '') and (rfilldate is not null)
union all
select rnum,rwound,workid,taskname,imgpath,wfillope as oper,wfillopename as opername,wfilldate as opdate
from wound where (wfillope is not null or wfillope <> '') and (wfilldate is not null)
union all
select rnum,rname,rdclass,rera,rwarehouse,cfillope as oper,cfillopename as opername,cfilldate as opdate
from catalog where (cfillope is not null or cfillope <> '') and (cfilldate is not null)
union all
select snumber,rnum,werifyrecord,werifyperson,werifydate,vfillope as oper,vfillopename as opername,vfilldate as opdate
from verify where (vfillope is not null or vfillope <> '') and (vfilldate is not null)
union all
select rnum,jjudger,jdate,jrem,jopinion,jfillope as oper,jfillopename as opername,jfilldate as opdate
from judge where (jfillope is not null or jfillope <> '') and (jfilldate is not null)
union all
select rnum,rclass,rgrade,rresource,rrefnum,rauditope as oper,rauditopename as opername,rauditdate as opdate
from relic where (rauditope is not null or rauditope <> '') and (rauditdate is not null)
union all
select rnum,rwound,workid,taskname,imgpath,wauditope as oper,wauditopename as opername,wauditdate as opdate
from wound where (wauditope is not null or wauditope <> '') and (wauditdate is not null)
union all
select rnum,rname,rdclass,rera,rwarehouse,cauditope as oper,cauditopename as opername,cauditdate as opdate
from catalog where (cauditope is not null or cauditope <> '') and (cauditdate is not null)
union all
select snumber,rnum,werifyrecord,werifyperson,werifydate,vauditope as oper,vauditopename as opername,vauditdate as opdate
from verify where (vauditope is not null or vauditope <> '') and (vauditdate is not null)
union all
select rnum,jjudger,jdate,jrem,jopinion,jauditope as oper,jauditopename as opername,jauditdate as opdate
from judge where (jauditope is not null or jauditope <> '') and (jauditdate is not null)
)大家帮我看下那的问题。
select rnum,oper,opername,opdate,rname,rclass,rdclass,rera.raccname,rgrade,rresource,rrefnum,rwarehouserwound,workid,taskname,imgpath,werifyrecord,werifyperson,werifydate,snumber,jjudger,jdate,jrem,jopinion from(
select rnum,rclass,rgrade,rresource,rrefnum,rfillope as oper,rfillopename as opername,rfilldate as opdate
from relic where (rfillope is not null or rfillope <> '') and (rfilldate is not null)
union all
select rnum,rwound,workid,taskname,imgpath,wfillope as oper,wfillopename as opername,wfilldate as opdate
from wound where (wfillope is not null or wfillope <> '') and (wfilldate is not null)
union all
select rnum,rname,rdclass,rera,rwarehouse,cfillope as oper,cfillopename as opername,cfilldate as opdate
from catalog where (cfillope is not null or cfillope <> '') and (cfilldate is not null)
union all
select snumber,rnum,werifyrecord,werifyperson,werifydate,vfillope as oper,vfillopename as opername,vfilldate as opdate
from verify where (vfillope is not null or vfillope <> '') and (vfilldate is not null)
union all
select rnum,jjudger,jdate,jrem,jopinion,jfillope as oper,jfillopename as opername,jfilldate as opdate
from judge where (jfillope is not null or jfillope <> '') and (jfilldate is not null)
union all
select rnum,rclass,rgrade,rresource,rrefnum,rauditope as oper,rauditopename as opername,rauditdate as opdate
from relic where (rauditope is not null or rauditope <> '') and (rauditdate is not null)
union all
select rnum,rwound,workid,taskname,imgpath,wauditope as oper,wauditopename as opername,wauditdate as opdate
from wound where (wauditope is not null or wauditope <> '') and (wauditdate is not null)
union all
select rnum,rname,rdclass,rera,rwarehouse,cauditope as oper,cauditopename as opername,cauditdate as opdate
from catalog where (cauditope is not null or cauditope <> '') and (cauditdate is not null)
union all
select snumber,rnum,werifyrecord,werifyperson,werifydate,vauditope as oper,vauditopename as opername,vauditdate as opdate
from verify where (vauditope is not null or vauditope <> '') and (vauditdate is not null)
union all
select rnum,jjudger,jdate,jrem,jopinion,jauditope as oper,jauditopename as opername,jauditdate as opdate
from judge where (jauditope is not null or jauditope <> '') and (jauditdate is not null)
)大家帮我看下那的问题。
union all
select v1,v2,0,.....
比如上面,你的外层SQL只能select c1,c2,c3,当然不用别名也行.
下面的语句没有v3,你就用常量代替,当然要和相应列的数据类型匹配.你的werifydate不在第一句sql里,当然提示无效.
反正要求就是每个SQL语句列数目要一样,每列的数据类型要一样.不够的用常量代替吧.