SELECT gwb.gwbm, gwb.dwmc, gwb.gwmc, gwb.gwlb, gwb.zprs,
(SELECT COUNT(*) AS rs FROM zyb WHERE (gwbm = gwb.gwbm) GROUP BY gwbm) AS ybrs
FROM gwb