读书人

求一句MYSQL话语

发布时间: 2011-12-08 21:33:54 作者: rapoo

求一句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

读书人网 >Java Web开发

热点推荐