I want to merge data coming from two tables :-
T1
-----
id c1 c2 switch
1 joe darling Y
1 maria kk N
T2
--------------
id d1 d2
1 sydney austraila
now if the switch in T1 is 'Y'
i want the output as
joe darling sydney australia // which is fine..
and if switch is 'N'
i still want the first and last name based on switch which is 'Y' and rest of the values from T2 table.
joe darling sydney australia //how to achieve this.