Not sure what is going on here…. I know it’s something to do with the max and group by statements… Any help greatly appreciated!
select
c_clm as ClaimNo,
i_pol as Policy,
d_rcv_clm as Received,
c_sta_clm as Status,
d_tmn_clm as Terminated,
c_tmn_clm as Reason,
MAX(pym.d_rls_pym) as Payment,
c_sgm as Segment
from ltc_p.VLTC_CLM_WK clm
left join pearl_p.TLTC915_PYM pym on
clm.i_sys_clm = pym.i_sys_clm
where c_sgm = 'am'
group by 1,2,3,4,5,6,7,8
Your seventh column is:
You can’t group by this. Change your group by clause to:
I changed the numbers to column names, since most databases do not support reference numbers in group bys. You can do the same thing as: