根据字段值分组,比如1,2一组,0另一组
SELECT count(1), CASE WHEN `status` IN (1, 2) THEN 3 ELSE 0 END
FROM investor
GROUP BY CASE WHEN `status` IN (1, 2) THEN 3 ELSE 0 END
或者
SELECT count(1), CASE WHEN inv.status IN (1,2) THEN 1 ELSE 0 END AS `status` FROM investor inv LEFT JOIN investor_finance inf ON inv.id = inf.investorId GROUP BY inv.status = 0