Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- [cardholder_index] ,
- CASE WHEN sex = 'M' THEN 1
- WHEN sex = 'F' THEN 2
- WHEN sex = 'U' THEN 0
- ELSE sex
- END AS sex,
- [group_month],
- [group_year],
- drinks_per_week,
- feel_stop_drinking,
- annoyed_by_criticizing_drinking,
- felt_bad_about_drinking,
- consider_overall_health,
- arthritis,
- asthma,
- bronchitis_emphysema,
- chd_chf_heart_attack,
- diabetes,
- high_blood_pressure,
- high_cholesterol,
- obesity,
- often_eat_out,
- comfortable_with_eating_habits,
- high_fat_foods,
- fried_foods,
- take_steps_to_maintain_weight,
- activity_30_minute_per_week,
- hours_exercise_per_day,
- satisifed_with_exercise,
- activity_30_minutes_4_or_more_per_week,
- felt_depressed,
- smoke,
- other_tobacco_products,
- spend_time_with_smokers
- FROM [healthreach_master].[dbo].[tbl_hra_import] t
- WHERE t.group_year = 2011 AND employer_group IN (
- SELECT VALUE
- FROM dbo.funcListToTable(N'1,2,3', ',') )
- AND hra_id = ( SELECT MAX(hra_id)
- FROM tbl_hra_import
- WHERE cardholder_index = t.cardholder_index
- AND SOURCE = 'file'
- AND group_year = 2011
- )
- ORDER BY cardholder_index
Add Comment
Please, Sign In to add comment