/*[sqlquery[*/ SELECT
policy_amount_attached.policy_amount_identifier,
policy_amount_attached.policy_amount ,
policy_amount_attached.amount_type_code ,
CASE when policy_amount_attached.amount_type_code = 'Year' then policy_amount_attached.policy_amount/12 end as monthly_policy_amount,
policy_amount_attached.policy_coverage_detail_identifier
FROM demo.acme.policy_amount_attached
JOIN demo.acme.premium_attached ON policy_amount_attached.policy_amount_identifier = premium_attached.policy_amount_identifier
/*]sqlquery]*/