Hi , I tried the below sql statement to the max dates but encountering the Not a single group error when executing
select case
when f.rv = 'AMER' then
(case
when (m.sc = 'A' and str_name = 'ST_DT1')
or (m.sc = 'B' and str_name = 'ST_DT2')
or (m.sc = 'C' and str_name = 'ST_DT3') then
max(m.stdt)
when (mc.sc = 'C' and str_name = 'ST_DT4')
or (mc.sc = 'K' and str_name = 'ST_DT5') then
max(mc.eddt)
else
null
end)
else
null
end
from memo_con mc
,baro_uy b
,fin f
,ped pe
where mc.id = b.id
and pe.id = mc.mid
and pe.id1 = 1234
and b.cd = f.cd
and f.id = 93;
Could you please suggest me the correct way on this.
Thank You