Sql |
-- Note: Unless you save your query, these tabs will NOT persist if you clear your cookies or change browsers.
SELECT COALESCE(indicator_no,indicator_old) as indicator_id,indicator,sub_indicator,short_names,decription,source,value,percentage
FROM(
SELECT indicator_no::VARCHAR as indicator_old,
CAST(CASE WHEN indicator_no = '5.1' AND decription IS NOT NULL THEN '5.10' ELSE NULL END AS VARCHAR) AS indicator_no,
CASE WHEN sub_indicator = 'a) Percentage of women age 20–24 years old who were first married or in union by age 18 '
THEN 'By age 18'
WHEN sub_indicator = 'b) Percentage of women age 20–24 years old who were first married or in union by age 18 and by age 15'
THEN 'By age 15'
WHEN sub_indicator = 'a) Percentage of women and girls aged 15–19 years who gave birth before 15 years of age'
THEN 'Age 15-19'
WHEN sub_indicator = 'b) Percentage of women aged 20–24 years who gave birth before 18 years of age'
THEN 'Before age 18' ELSE NULL END AS short_names,sub_indicator,
indicator,decription,source,value,percentage
FROM summary.domain_five_summary_table)foo
|