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
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
转载于:https://www.cnblogs.com/xusy/p/4831808.html