求助,求一mysql查询表达式 本帖最后由 lziyanl 于 2012-11-22 21:07:20 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from(select count(*) AS counts1 from A where A.state = 1) a,(select count(*) AS counts2 from A where A.state2 = 0) b select sum(if(state = 1,1,0)) as counts1,sum(if(state2 = 1,0,1)) as counts2from A select count(case when state=1 then 1 else 0 end) as num1,count(case when state=0 then 1 else 0 end) as num2from A 求一MySQL语句 vc 2005 中怎样使用mysql 面试题 求学生平均分大于n的学生 mysql语法问题 关于索引的问题 救救我把,数据更新字段的问题,我搞了一天都没有搞出来] 如何开起InnoDB? 请问如何将ms sql2000的数据导给mysql,谢谢. w2k下mysql意外中断怎么办啊! 如何去掉数组中值为null的键值对? MYsql创建视图如何删除重复字段? MySQL 语法求解
(select count(*) AS counts1 from A where A.state = 1) a,
(select count(*) AS counts2 from A where A.state2 = 0) b
from A
select count(case when state=1 then 1 else 0 end) as num1,
count(case when state=0 then 1 else 0 end) as num2
from A