日期:2014-05-18  浏览次数:20703 次

求一句MYSQL语句
我有一个表
table1
字段1   字段2  
content   id自增
好             1
不好         2
一般         3
好               4
一般           5
。。

。。。

。。
我想查出字段   好的记录。不好的记录。一般的记录来。怎么查啊

------解决方案--------------------
写错了
select aa.a as '好 ',bb.b as '一般 ',cc.c as '不好 ' from
(select count(content) as a from table1 where content= '好 ') aa,
(select count(content) as b from table1 where content= '一般 ') bb,
(select count(content) as c from table1 where content= '不好 ') cc