Thursday, 22 December 2011

SQL

SELECT *
  FROM fnd_request_groups
 WHERE request_group_id IN (
          SELECT DISTINCT request_group_id
                     FROM fnd_request_group_units
                    WHERE request_unit_id IN (
                             SELECT concurrent_program_id
                               FROM fnd_concurrent_programs_tl
                              WHERE user_concurrent_program_name LIKE
                                                     'program_name'))

-- FIND THE RESPONSIBILITY ASSIGNED TO REQUEST GROUP WITH ASSIGNED CONCURRENT PROGRAM
SELECT *
  FROM fnd_responsibility_tl
 WHERE responsibility_id IN (
          SELECT responsibility_id
            FROM fnd_responsibility
           WHERE request_group_id IN (
                    SELECT request_group_id
                      FROM fnd_request_groups
                     WHERE request_group_id IN (
                              SELECT DISTINCT request_group_id
                                         FROM fnd_request_group_units
                                        WHERE request_unit_id IN (
                                                 SELECT concurrent_program_id
                                                   FROM fnd_concurrent_programs_tl
                                                  WHERE user_concurrent_program_name LIKE
                                                           'program name'))))

No comments:

Post a Comment