Would like to get percentage for generated column. Any idea on how to do that??
Following SQL statement
Expand|Select|Wrap|Line Numbers
- SELECT s.Selection_Desc, count(u.user_id)
- from tbl_system_selection s, tbl_user u, tbl_user_company c
- where s.selection_type = 'INDUSTRY'
- and u.User_Company_ID = c.Company_ID
- and c.Company_Industry_ID = s.Selection_ID
- and u.user_activated = '1'
- group by s.selection_id
gives the result of
======================================
Expand|Select|Wrap|Line Numbers
- Selection_desc count(u.user_id)
- Marketing 44
- Sales 54
- Finance 100
i would like to get percentage for each row
for example Finance shd give 50% (100/(45+55+100))*100)
======================================
Expand|Select|Wrap|Line Numbers
- Selection_desc count(u.user_id) perc
- Marketing 45 22.5
- Sales 55 27.5
- Finance 100 50