I have two tables such as TableA and TableB.
Schema for TableA:
UoMID
UoMName
Schema for TableB:
ItemID
ItemName
UoMID
D1_UoMID
D2_UoMID
D3_UoMID
Here I want to Join Both these tables based on UoMID in the TableA and UoMID, D1_UoMID, D2_UoMID and D3_UoMID in the TableB.
I want to retrieve the following columns:
ItemName, UoMName, D1_UoMName, D2_UoMName and D3_UoMName
How to retreive the above columns? and How do I identify the UoMName for the Corresponding UoMID, D1_UoMID, D2_UoMID and D3_UoMID?
Using aliases, you can join to the same table multiple times and distinguish the results of the different joins. Try this: