こんにちは、クエリを作成しています。2 番目の左結合を追加した後に問題が発生します:- 2 番目の結合を追加する前に正常に動作します。この問題を解決できますか
SELECT u.dept_name AS deptname, u.user_name AS username,
u.user_id AS userid, u.single_id AS singleid,
u.email_address AS emailaddress, to_char(m.cur_week_hits) AS empno,
to_char(m.prev_week_hits) AS mobiletelno,r.role_id , r.role_name
to_char(m.cur_week_hits - m.prev_week_hits) AS comptelno
FROM tn_cf_user u
LEFT JOIN
(
SELECT
SUM (cur_week_hits) AS cur_week_hits,
SUM (prev_week_hits) AS prev_week_hits,
user_id
FROM pp
GROUP BY user_id ) m
ON u.user_id = m.user_id
LEFT JOIN
(
SELECT ur.role_id , rn.role_name , ur.user_id
FROM tn_cf_user_role ur , tn_cf_role rn
WHERE ur.role_id = rn.role_id
) r,
ON u.user_id = r.user_id
AND u.single_id IS NOT NULL
AND u.user_type IS NULL
ありがとう