oracle 连接查询 select count(*) as count,o.organ_name from PUB_USERS u,t_req_vote_result r,PUB_Organ o where u.user_id= r.user_id and (select substr(organ_id,2,16) from PUB_Organ) =(select substr(EMPLOYEE_ID,2,16) from PUB_USERS) group by organ_name
SELECT COUNT(*) AS COUNT, O.ORGAN_NAME
FROM PUB_USERS U, T_REQ_VOTE_RESULT R, PUB_ORGAN O
WHERE U.USER_ID = R.USER_ID
AND SUBSTR(O.ORGAN_ID, 2, 16) = SUBSTR(U.EMPLOYEE_ID, 2, 16)
GROUP BY ORGAN_NAME
------解决方案--------------------