How to use subselect in a case statement
,case when g.GFGSTS = '2'
and not exists
(select a.GFTSEQ
from GFTP010 a
where a.GFCSQ# = g.GFCSQ#
and a.GFGSTS = '3' )
then count(*) end as Void#
Looking for relevant Development Whitepapers? Visit the SearchWinDevelopment.com Research Library.