--查询到 pac_period_id 期间
select pac_period_id from
(
select cpp.pac_period_id,cpp.period_name
from cst_pac_periods cpp
where cpp.legal_entity = 102
order by cpp.pac_period_id desc)
where rownum=1 ; --查询到material_id,material_price物料编码和价格
select tpam.material_id
,tpam.material_price
from tg_purchase_acc_materials tpam
where tpam.material_desc = '银'
and tpam.status = 'Active';
-- status ENTRY 状态情况如何把这四个字段汇集到一张表中,形成一行数据
select pac_period_id from
(
select cpp.pac_period_id,cpp.period_name
from cst_pac_periods cpp
where cpp.legal_entity = 102
order by cpp.pac_period_id desc)
where rownum=1 ; union all --查询到material_id,material_price物料编码和价格
select tpam.material_id
,tpam.material_price
from tg_purchase_acc_materials tpam
where tpam.material_desc = '银'
and tpam.status = 'Active';
-- status ENTRY 状态情况
select 1, null 2, null 3
from t1
union all
select null 1, 2, 3
from t2