博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

查询职责及应用的SQL

Posted on 2012-12-06 09:58  奥客  阅读(269)  评论(0编辑  收藏  举报

--销售、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