See the following scenario: Tables for the question:
Table : T1
c10 c12
e1 A
e2 B
e3 C
Table: T2
c1 c2 c3 c4 c5 C6
1 P e1 e2 null X
2 Q e3 null null Y
3 R e2 e1 null X
4 S e3 e1 e2 Z
The c3, c4 and c5 columns of T2 table depends on c12 column of T1 table.
I want the following output:
c1 c2 c3 c4 c5
1 P A B null
2 Q C null null
3 R B A null
4 S C A B
Can you help me to write an SQL to retrieve the above output from the table T1 and T2? The SQL may be like:
Select c1, c2, t1.c12 as c3....... from t1, t2 where join condition
But I am not getting the actual sql in my mind. So please help me regarding this.