select remark,count(remark) as amount from tb_busirecord where optcode = 'SEARCH' group by remark order by count(remark) desc
请问我怎么算出我所查出数据的数量占总数量的百分比呢?结果保留两位小数
round( )去看看
最好是先查询出总量total;
然后再执行:
select remark,count(remark) as amount,round(count(remark)/total,2)
from tb_busirecord where optcode = 'SEARCH' group by remark order by count(remark) desc
这样效率会高,嵌套查询效率会滴
如果有帮助,希望采纳