Ver originalSELECT SUM(IF(A=1,1,0)) valor1, SUM(IF(B<>'',1,0)) valor2, SUM(IF(A=0 AND B<>'', 1, 0) valor3FROM tabla;
Ver originalSELECT COUNT(T1.A) valor1, COUNT(T2.B) valor2, COUNT(T3.A) valor3FROM tabla T1 JOIN tabla T2, JOIN tabla T3WHERE T1.A=1 OR T2.B<>'' OR (T1.A=1 AND T2.B<>'');