In below teradata SQL code I want to join 3 different columns from table A (col1,col2,col3) with employee table's name column. Below operation working fine but want to perform this operation within one join, can we do that with alternate way to avoid multiple joins on same table? I'm getting spool space error due multiple joins with views.
Select (case when P.name is not null then A.col1 else null end)name1,
(case when Q.name is not null then A.col2 else null end)name2,
(case when R.name is not null then A.col3 else null end)name3
From A Left join
employee P
on P.name = A.col1 Left join
employee Q
on Q.name = A.col2 Left join
employee R on R.name = A.col3