select v.OBID,CONCAT(`item_count`/(select sum(item_count)from vote_item)*100,'%') as '百分比',s.text
from `vote_item` v,`vote_subject` s
where s.OBID = v.fk_subject
sql查询百分比
最新推荐文章于 2022-12-22 14:29:38 发布
select v.OBID,CONCAT(`item_count`/(select sum(item_count)from vote_item)*100,'%') as '百分比',s.text
from `vote_item` v,`vote_subject` s
where s.OBID = v.fk_subject