mysql的子查询
在论坛中看到mysql4.0支持子查询,但我写了如下语句,却不行!
select bj ,sum(zcrs),sum(zdrs) from
(
select bj,count(xh) zcrs,count(xh) zdrs from xj where xjbd>=0 group by bj
union all
select bj,0 zcrs,-count(xh) zdrs from xj where xjbd=1 group by bj
) as newtab
group by bj
这是为何?