--销售、MDC、销售管理部、采购、订单
SELECT *
FROM(
SELECT fd.RESPONSIBILITY_ID,fv.RESPONSIBILITY_NAME,RESPONSIBILITY_APPLICATION_ID,fa.APPLICATION_SHORT_NAME,fa.APPLICATION_NAME,fa.DESCRIPTION
FROM FND_USER_RESP_GROUPS_DIRECT fd
,FND_RESPONSIBILITY_VL fv
,FND_APPLICATION_VL fa
WHERE fd.RESPONSIBILITY_ID=fv.RESPONSIBILITY_ID
AND fd.RESPONSIBILITY_APPLICATION_ID=fv.APPLICATION_ID
AND fd.RESPONSIBILITY_APPLICATION_ID=fa.APPLICATION_ID
AND fd.user_id IN (
SELECT user_id
FROM fnd_user
WHERE user_name IN (
)
)
AND SYSDATE BETWEEN fd.START_DATE AND NVL(fd.END_DATE,SYSDATE)
GROUP BY fd.RESPONSIBILITY_ID,fv.RESPONSIBILITY_NAME,RESPONSIBILITY_APPLICATION_ID,fa.APPLICATION_SHORT_NAME,fa.APPLICATION_NAME,fa.DESCRIPTION
) vresp
ORDER BY RESPONSIBILITY_APPLICATION_ID,RESPONSIBILITY_NAME
--物流、财务(应收、应付、总帐、现金、固资、VAT)、系统管理
SELECT *
FROM(
SELECT fd.RESPONSIBILITY_ID,fv.RESPONSIBILITY_NAME,RESPONSIBILITY_APPLICATION_ID,fa.APPLICATION_SHORT_NAME,fa.APPLICATION_NAME,fa.DESCRIPTION
FROM FND_USER_RESP_GROUPS_DIRECT fd
,FND_RESPONSIBILITY_VL fv
,FND_APPLICATION_VL fa
WHERE fd.RESPONSIBILITY_ID=fv.RESPONSIBILITY_ID
AND fd.RESPONSIBILITY_APPLICATION_ID=fv.APPLICATION_ID
AND fd.RESPONSIBILITY_APPLICATION_ID=fa.APPLICATION_ID
AND fd.user_id IN (
SELECT user_id
FROM fnd_user
WHERE user_name IN (
)
)
AND SYSDATE BETWEEN fd.START_DATE AND NVL(fd.END_DATE,SYSDATE)
GROUP BY fd.RESPONSIBILITY_ID,fv.RESPONSIBILITY_NAME,RESPONSIBILITY_APPLICATION_ID,fa.APPLICATION_SHORT_NAME,fa.APPLICATION_NAME,fa.DESCRIPTION
) vresp
ORDER BY RESPONSIBILITY_APPLICATION_ID,RESPONSIBILITY_NAME