Hello All –
Please help!
I need to select members with APP = F and app not in SFHS or SFHF
Input Data:
My Statement (does not work)
It should be some sort of an inner join may be?
This takes care of SFHS & SFHS records
THANKS FOR YOUR HELP!
Cristi
Please help!
I need to select members with APP = F and app not in SFHS or SFHF
Input Data:
Code:
Empl app marit
9990003 F S
9990003 SFHS M
9990003 SFHS S
9990003 SFHS S
My Statement (does not work)
Code:
SELECT employer , period,
(case app when 'F' then (case MARIT when 'M' then 'STANDARD_FAMILY' else 'STANDARD_SINGLE' end) else '' end) plandesc,
Count(distinct ssn) tot_cnt FROM umass_contr
WHERE
period = date('2005-07-01') and APP IN ('F' ) [COLOR=red]and ssn not in ( select distinct ssn from umass_contr where app in ('SFHS','SFHF') and period = date('2005-07-01') ) [/color] GROUP BY employer, period, (case app when 'F' then (case MARIT when 'M' then 'STANDARD_FAMILY' else 'STANDARD_SINGLE' end) else ''end)
It should be some sort of an inner join may be?
This takes care of SFHS & SFHS records
Code:
SELECT employer , period, (case app when 'SFHS' then 'HIGH_SINGLE' when 'SFHF' then 'HIGH_FAMILY' else '' end) plandesc, Count(distinct ssn) tot_cnt
FROM umass_contr WHERE period = date('2005-07-01') and APP IN ('SFHS', 'SFHF' ) GROUP BY employer, period,
(case app when 'SFHS' then 'HIGH_SINGLE'
when 'SFHF' then 'HIGH_FAMILY' else '' end)
THANKS FOR YOUR HELP!
Cristi