on 2016 Sep 15 2:36 PM
Hi All,
Here is my requirement.
COLUMN1 | COLUMN2 | EXPECTED RESULT COLUMN |
1 | X | XMEN |
1 | Y | XMEN |
1 | Y | XMEN |
2 | Y | NULL |
2 | Y | NULL |
3 | Y | XMEN |
3 | Y | XMEN |
3 | X | XMEN |
3 | X | XMEN |
In column2 if any records contains X value then for related records should populate as xmen.
key 1 has 3 values and it contains x, so expected result of all three should be xmen.
How can I achieve this result.
In Query_1, group by COLUMN1 and map COLUMN2 to min(COLUMN2).
In Query_2, do not map COLUMN2 to output, map COLUMN3 to decode(COLUMN2='X';'XMEN',null).
In Query_3, join source table to Query_2 output on COLUMN1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.