restrict viewing projects based on business unit and class category code
We have to restrict viewing projects based on business unit and class category code. We have been able to partially achieve this with the query below, but we are still facing some instability in the results: Also, we have to modify this SQL to add the BU restriction as well. Appreciate your help if this is feasible or not.
&TABLE_ALIAS.PROJECT_ID IN (select distinct PA.PROJECT_ID from PJF_PROJECTS_ALL_VL PA, PJF_PROJECT_CLASSES PC , PJF_CLASS_CODES_B CCO, PJF_CLASS_CODES_VL CCOV , PJF_CLASS_CATEGORIES_B CCA , PJF_CLASS_CATEGORIES_TL CCAV where CCO.CLASS_CATEGORY_ID = CCA.CLASS_CATEGORY_ID and CCOV.CLASS_CODE_ID = CCO.CLASS_CODE_ID AND CCA.CLASS_CATEGORY_ID = CCAV.CLASS_CATEGORY_ID and PA.PROJECT_ID=PC.PROJECT_ID and PC.CLASS_CATEGORY_ID = CCA.CLASS_CATEGORY_ID and CCAV.CLASS_CATEGORY = 'Functional Group' and CCOV.CLASS_CODE = 'Services')