select a.fenlei, count(*), count(*)/(select count(*) from test)*100 as percentage, constitute<br />from test a, (select fenlei, group_concat(mc,',',cnt) as constitute from<br />(select fenlei, mc, count(*) as cnt from test group by 1,2) t group by 1) t1<br />where a.fenlei=t1.fenlei<br /> group by 1
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn