Hello all -
I need to UNION the following SELECT into the rest of my procedure
The output should look like:
MY SELECT:
Here is the results from my select statment:
THANKS A LOT,
Cristi
I need to UNION the following SELECT into the rest of my procedure
The output should look like:
Code:
employer period FAMILY SINGLE
9990001 1-Jul-05 267 176
MY SELECT:
Code:
SELECT
e.employer ,
e.period,
count( distinct e.ssn) tot_cnt,
(case e.app when 'SFHS' then 'HIGH_SINGLE' when 'SFHF' then 'HIGH_FAMILY' else '' end) plandesc
FROM umass_contr l inner join umass_contr r on l.period = (date('2005-07-01') - 6 month)
and r.period =(date('2005-07-01') - 1 month) and l.ssn = r.ssn
and l.employer=r.employer
inner join umass_contr e on e.ssn=l.ssn and e.ssn=r.ssn and l.employer=r.employer
and e.employer=r.employer
WHERE
e.period = date('2005-07-01')
and e.APP IN ('SFHS', 'SFHF' )
GROUP BY
e.employer, e.period,
(case e.app when 'SFHS' then 'HIGH_SINGLE'
when 'SFHF' then 'HIGH_FAMILY' else '' end)
Here is the results from my select statment:
Code:
EMPLOYE PERIOD TOT_CNT PLANDESC
9990001 1-Jul-05 267 FAMILY
9990001 1-Jul-05 176 SINGLE
THANKS A LOT,
Cristi