规划院培训费用统计查询的sql语句

create or replace view pxfy_view as
select t1.form_id,t1.reserve as mid,t1.feiyong,t.cjpxr_name as full_name,1 as pxlx,t1.topic,t1.identity,
t1.begin_time as CREATEDATE,t1.end_time as completedate,pv.city,pv.DEPT_ID
from wf_oa_pxnb_cjry t,WF_OA_PXNB t1,person_view pv where t.form_id=t1.form_id and t.cjpxr=pv.ACCOUNT

union all
select t1.form_id,t1.reserve as mid,t1.feiyong,t.cjr_name as full_name,0 as pxlx,t1.topic,t1.identity,
t1.begin_time as CREATEDATE,t1.end_time as completedate,pv.city,pv.DEPT_ID
from wf_oa_px_pxjl t,WF_OA_PX t1,person_view pv where t.form_id=t1.form_id and t.cjr=pv.ACCOUNT

你可能感兴趣的:(sql语句)