Write a query to find the second-highest premium policy within each region.
Return policies whose premium is the second-highest distinct premium in their region. Include tied policies at that premium level and exclude policies without a premium.
policy_id, region_name, premium, and premium_rank.region_name, then policy_id.| Column | Type | Description |
|---|---|---|
| policy_idPK | INT | Unique policy identifier |
| region_id | INT | Identifier of the policy region |
| policyholder_name | VARCHAR(100) | Name of the policyholder |
| premium | DECIMAL(12,2) | Policy premium amount |
| Column | Type | Description |
|---|---|---|
| region_idPK | INT | Unique region identifier |
| region_name | VARCHAR(50) | Region name |