Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Can multiple joins be avoided for the same table? - forum topic by pavan.polish

$
0
0

Hi All,
I have a requirement as below:
Table1:-
Group_ID - Member_ID
A - B
A - C
X - Y
X - Z
Table2:-
ID - Value1 - Value2
A - 111 - 222
B - 444 - 666
C - 566 - 556
X - 999 - 777
Y - 444 - 555
Z - 433 - 876
Output:-
Group_ID - Group_val1 - Group_val2 - Member_ID - Member_val1 - Member_val2
A - 111 - 222 - B - 444 - 666
A - 111 - 222 - C - 566 - 556
X - 999 - 777 - Y - 444 - 555
X - 999 - 777 - Z - 433 - 876
Logic:- I need to join Table1 to Table2 once with Group_ID to get values and again with Member_ID to get the values to get the required output.
Thought of checking whether the same can be achieved with a single join to get the required output.
Thanks a lot in advance.
Regards,
Sagar

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>