select t.项目代码,t.项目名称,t.我院单价,t.二级医院单价,sum(t.数量),sum(t.金额)  from (
select '门诊' 地点,
       a.item_id 项目代码,
       a.item_cnname 项目名称,
       a.item_std 单位,
       a.rprice 我院单价,
       c.je_a 二级医院单价,
       sum(a.quantity) 数量,
       sum(a.sum_total) 金额
  from op.op_charge a left join Temp_cont5 c on a.item_id=c.dm_a left join Temp_cont5 c on a.item_id=c.dm_a, op.op_chgnote b
 where a.chgnote_id = b.chgnote_id
   and a.logcdate >= to_date('20150101', 'yyyymmdd')
   and a.logcdate < to_date('20150111', 'yyyymmdd') + 1
   and b.csreport_id <> 'NONE'
   and b.ssubsys_id = '68'
   and a.medcatype_id not in ('P17', 'P21', 'P22', 'P23')
 group by a.item_id, a.item_cnname, a.item_std, a.rprice,c.je_a
 union
 select '住院' 地点,
       a.xmdm 项目代码,
       a.xmmc 项目名称,
       a.danwei 单位,
       b.rprice_op 我院单价,
       c.je_a 二级医院单价,
       sum(a.xmsl) 数量,
       sum(a.jine) 金额
  from ndns.mx a left join Temp_cont5 c on a.xmdm=c.dm_a left join Temp_cont5 d on a.xmdm=c.dm_a, hthis.p_item b
 where a.xmdm = b.item_id
   and a.fsrq >= to_date('20150101', 'yyyymmdd')
   and a.fsrq < to_date('20150111', 'yyyymmdd') + 1
   and a.hsfl not in ('P17', 'P21', 'P22', 'P23')
 group by a.xmdm, a.xmmc, a.danwei, b.rprice_op,c.je_a) t
 group by t.项目代码,t.项目名称,t.我院单价,t.二级医院单价
 order by t.项目代码这个他说未明确定义列,什么意思。