Hi,
Would like to get percentage for generated column. Any idea on how to do that??
Following SQL statement
[CODE=mysql]SELECT s.Selection_Des c, count(u.user_id )
from tbl_system_sele ction s, tbl_user u, tbl_user_compan y c
where s.selection_typ e = 'INDUSTRY'
and u.User_Company_ ID = c.Company_ID
and c.Company_Indus try_ID = s.Selection_ID
and u.user_activate d = '1'
group by s.selection_id[/CODE]
gives the result of
=============== =============== ========
=============== =============== =========
i would like to get percentage for each row
for example Finance shd give 50% (100/(45+55+100))*10 0)
=============== =============== ========
=============== =============== =======
Would like to get percentage for generated column. Any idea on how to do that??
Following SQL statement
[CODE=mysql]SELECT s.Selection_Des c, count(u.user_id )
from tbl_system_sele ction s, tbl_user u, tbl_user_compan y c
where s.selection_typ e = 'INDUSTRY'
and u.User_Company_ ID = c.Company_ID
and c.Company_Indus try_ID = s.Selection_ID
and u.user_activate d = '1'
group by s.selection_id[/CODE]
gives the result of
=============== =============== ========
Code:
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))*10 0)
=============== =============== ========
Code:
Selection_desc count(u.user_id) perc Marketing 45 22.5 Sales 55 27.5 Finance 100 50
Comment