[Quote=引用 6 楼 java_caicai 的回复:]
select name,count(case when chenji='好' then chenji end),
count(case when chenji='差' then chenji end),
count(case when chenji='中等' then chenji end),
from table group by typeName 或group by addTime
select name,count(case when chenji='好' then chenji end),
count(case when chenji='差' then chenji end),
count(case when chenji='中等' then chenji end),
from table group by typeName 或group by addTime