日期:2014-05-17  浏览次数:21030 次

oracle中报缺失表达式的错误,写错了吗,希望各位指点下
select distinct h.batchno as 批次号,
  h.gpolicyno as 保单号,
  c.name as 姓名,
  h.pid as 身份证号,
  h.listtype as 单据类型,
  sum(h.sumrec) as 总金额,
  sum(h.payrec) as 自费金额,
  sum(h.pay2rec) as 自付二金额,
  sum(h.plapay) as 统支金额,
  sum(h.pay1rec) as 自付一金额,
  sum(socadd) as 社保补充,
  hg.workst as 类别,
  sum(h.deductiblerec) as 免赔额,
  nvl(h.selfscale, 0) as 自付段比例,
  nvl(h.togscale, 0) as 共付段比例,
  sum(h.socbase) as 社保起付线,
  sum(reducerec) as 交叉扣减金额,
  sum(recmod) as 金额调整,
  sum(h.selfpay) as 自付段给付,
  sum(h.togpay) as 共付段给付,
  sum(h.paymentrec) as 计算给付金额,
  h.printst as 分割单开据,
  dr.cdg_batch as 华道批次号,
  dr.CDG_POINTS_CASE_NO as 华道分案号,
  hc.oc_sqrq as 理赔申请日期
  from hclaimlist_cli h
  left join custmatl c
  on h.pid = c.id
  left join V_HGRPLIST hg
  on h.pid = hg.pid
  and h.gpolicyno = hg.gpolicyno
  left join v_gpolicyno_company g
  on h.gpolicyno = g.gpolicyno
  left join hclaimlist hc
  on h.batchno = hc.batchno
  left join hhosinfo a
  on h.hosid = a.hosid
  left join hillinfo b
  on h.illid = b.illid
  left join security_users d
  on h.operno = d.name
  left join security_users e
  on h.c_fhry = e.name
  left join dr_cdg_date dr
  on h.Claimdocno = dr.claimdocno
 where 
  h.respcode in ('27341100', '27490100')
  and h.listtype='4'
  and h.batchno in ('J1200073')
 group by h.batchno,
  h.gpolicyno,
  c.name,
  h.pid,
  h.listtype,
  hg.workst,
  h.selfscale,
  h.togscale,
  h.printst,
  dr.cdg_batch,
  hc.oc_sqrq,
  dr.CDG_POINTS_CASE_NO

  union all
  select distinct h.batchno as 批次号,
  h.gpolicyno as 保单号,
  c.name as 姓名,
  h.pid as 身份证号,
  h.listtype as 单据类型,
  h.sumrec as 总金额,
  h.payrec as 自费金额,
  h.pay2rec as 自付二金额,
  h.plapay as 统支金额,
  h.pay1rec as 自付一金额,
  socadd as 社保补充,
  hg.workst as 类别,
  h.deductiblerec as 免赔额,
  nvl(h.selfscale, 0) as 自付段比例,
  nvl(h.togscale, 0) as 共付段比例,
  h.socbase as 社保起付线,
  reducerec as 交叉扣减金额,
  recmod as 金额调整,
  nvl(h.selfpay,0) as 自付段给付,
  nvl(h.togpay,0) as 共付段给付,
  h.paymentrec as 计算给付金额,
  h.printst as 分割单开据,
  dr.cdg_batch as 华道批次号,
  dr.CDG_POINTS_CASE_NO as 华道分案号,
  hc.oc_sqrq as 理赔申请日期
  from hclaimlist_cli h
  left join custmatl c
  on h.pid = c.id
  left join V_HGRPLIST hg
  on h.pid = hg.pid
&