PL/SQL (MOSC)

MOSC Banner

transpose row to column with condition

edited Aug 26, 2013 9:16PM in PL/SQL (MOSC) 5 commentsAnswered
 Hi all,
I need help to write SQL or PL/SQL or etc.. to fulfill below requirement.. when use pass the like option_id = 5
so based option_id=5, it should create string for dependent option like 
(option_id=3 AND option_id=4 OR option_id=2 ) OR (option_id=5 AND option_id=6 ) AND (option_id=7 AND option_id=8 ) or as per data available in table.



Table 1 : PLATFORM_OPTION_RULE

Column        Type        Key   Notes
RULE_ID        NUMBER(10) Primary
OPTION_ID NUMBER(10)
CONDITION VARCHAR2(10)   Values will be  AND/OR
SEQUENCE NUMBER(10)


Data:

RULE_ID         OPTION_ID          CONDITION      SEQUENCE
1 5   OR             1
2 5                  AND            2
3 5   NULL  3


This table will contain rules for option dependency for any option if it has dependency on other options.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center