查询某表的a字段的总数和b字段的符合某条件的总数
表table1:
a b
1 q
2 v
3 n
4 b
2 b
------------------
我想查询a字段的count数,和b= 'b '的count数.
高手sql怎么写呢
[解决办法]
SELECT TA.aALL,TB.bALL FROM (SELECT COUNT(A) AS aALL FROM TABLE1) TA,
(SELECT COUNT(B) AS bALL FROM TABLE1 WHERE b= 'b ') TB