求一统计的sql语句 select sum(case when thing1>1 then 1 else 0 end) thing1记录数,sum(case when thing2>2 then 1 else 0 end) thing2记录数from 表 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select (select count(thing1) thing1 from mytest where thing1>1) thing1, (select count(thing1) thing1 from mytest where thing2>2) thing2 select sum( case when thing1>1 then 1 else 0 end) sum_thing1,sum( case when thing1>2 then 1 else 0 end) sum_thing1from tablename 请教在一张表中复制并插入记录的问题,谢谢? 两个表 共有一个字段id 求符合条件的数据 请问下树形网站数据库的设计 能否给视图加参数????? 比较难的问题--》怎么获取联合查询语句得出的记录集的字段???明早给分 xp sp2下不能安装SQL2000该怎么办? 如何找出数据库中所有的索引和其对应的表 ibatis问题~~~ 初学~求助 求救!!!如何用SQLSERVER修改系统管理员密码?? jsp通过odbc如何访问SQL server 2000数据库 小焦紧急求救,如果后天在弄不出来,会吃鱿鱼的,拨号连接数据库问题 请问 怎样在查询时生成新的字段和结果?
(select count(thing1) thing1 from mytest where thing2>2) thing2
sum( case when thing1>1 then 1 else 0 end) sum_thing1,
sum( case when thing1>2 then 1 else 0 end) sum_thing1
from tablename