Write a query to find the top 3 performing assets per sector for each month, given a table of daily returns.
Treat an asset's monthly performance as the sum of its non-null daily returns. Return available results when a sector and month contain fewer than three assets.
month, sector, asset_id, monthly_return, and performance_rank.asset_id ascending.month, sector, and performance_rank.| Column | Type | Description |
|---|---|---|
| return_idPK | INT | Unique identifier for the daily return record |
| asset_id | VARCHAR(20) | Identifier of the traded asset |
| sector | VARCHAR(50) | Sector classification for the asset |
| return_date | DATE | Date associated with the daily return |
| daily_return | DECIMAL(10,6) | Daily return expressed as a decimal |