SQL查询-巧用记录数统计人数

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

posted @ 2015-09-23 11:52  xashxsy  阅读(1044)  评论(0编辑  收藏  举报