Hello all -
db2 udb 9.2
Can anyone please tell me why 'AS'does not work ?
thanks for your help
error:
SQL0104N An unexpected token "'UMASS_DART_SINGLE_HIGH'" was
found following "ber_ssn end) as". Expected tokens may
include: "<space> ".
db2 udb 9.2
Can anyone please tell me why 'AS'does not work ?
Code:
SELECT
usr_empl_name
, count (case when usr_empl_name = 'UMASS DART' and coverage_code = 'C' and benefit_plan = 'DOHIGH' then member_ssn end) [COLOR=RED] as 'UMASS_DART_SINGLE_HIGH'[/COLOR]
, count (case when usr_empl_name = 'UMASS MEDICAL' and coverage_code = 'C' and benefit_plan = 'DOHIGH' then member_ssn end)
, count (case when usr_empl_name = 'UMASS MEMORIAL' and coverage_code = 'C' and benefit_plan = 'DOHIGH' then member_ssn end)
, case coverage_code when 'C' then 'SINGLE ENROLLED' when 'A' then 'FAMILY ENROLLED' else 'NULL' end
, case benefit_plan when 'DOSTAN' then 'STANDARD' when 'DOHIGH' then 'HIGH' else 'NULL' end
, count(member_ssn) as members
FROM
elg_summary , umass_empl
WHERE
employer=empl
and ben_date = DATE('2005-07-01')
and dep_name = '' and dep_ssn = ''
and coverage_code <> 'D'
and benefit_plan in ('DOSTAN','DOHIGH')
GROUP BY
usr_empl_name
, benefit_plan
, coverage_code
, ben_date
thanks for your help
error:
SQL0104N An unexpected token "'UMASS_DART_SINGLE_HIGH'" was
found following "ber_ssn end) as". Expected tokens may
include: "<space> ".