日期:2014-05-16 浏览次数:20565 次
select t.WELLITEM_ID, co.ORG_ABBREVIATION as WELLITEM_NAME, t.WELL_ID, cb.WELL_NAME max(decode(MATERIAL_CODE, '1001', MATERIAL_RESERVES,null)) as rh, -- 日耗 max(decode(MATERIAL_CODE, '1002', MATERIAL_RESERVES,null)) as kc -- 库存 from MATERIAL t LEFT JOIN COMM_ORG_INFORMATION co ON( t.WELLITEM_ID = co.ORG_ID ) LEFT JOIN COMM_BASE_WELL_INFO cb ON( t.WELL_ID = cb.WELL_ID ) where TO_CHAR(t.daily_date,'yyyy-mm-dd')='2012-12-12' group by t.WELLITEM_ID,t.well_id,co.ORG_ABBREVIATION,cb.WELL_NAME