'SQL query for view contribution percent
I have to calculate % contribution for each category.
select portfolio,Portfolio_views,Portfolio_views/total_views*100 as perc_contribution
from (
select category,sum(views) as Portfolio_views,select sum(portfolio_views) from gold.user_daily_osv as total_views
from gold.user_daily_osv
group by category
)
but this throws error: line 2:40: mismatched input 'select'. Expecting: '*',
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

