sandeep0000
Programmer
i am using sql server
select cs_id,net_ben_amt,max(upd_dtm) a
from cis.dbo.ag_elig_rslt ager
where
pay_mnth = '200610'
and cur_elig_ind in ('a','p')
and ager.delt_rcrd_sw = 'N'
and ager.elig_sts_cd = 'PS'
and ager.pgm_typ_cd = 'CW'
and cs_id = 'BA43183'
group by cs_id,net_ben_amt
this is my query, for this record i have a cur_elig_ind of a and p. how can i tell my query if i have 'a' then i dont care about 'p' but if i dont have 'a' then i want 'p'
select cs_id,net_ben_amt,max(upd_dtm) a
from cis.dbo.ag_elig_rslt ager
where
pay_mnth = '200610'
and cur_elig_ind in ('a','p')
and ager.delt_rcrd_sw = 'N'
and ager.elig_sts_cd = 'PS'
and ager.pgm_typ_cd = 'CW'
and cs_id = 'BA43183'
group by cs_id,net_ben_amt
this is my query, for this record i have a cur_elig_ind of a and p. how can i tell my query if i have 'a' then i dont care about 'p' but if i dont have 'a' then i want 'p'