I have a scenario in this way:
Source Table
Inventory
Alocation| Blocation
ABC DEF
Destination Table
LocationID
Mapping Table
LocationID, Location
1 ABC
2 DEF
Now I have to write a query wherey both the location codes should be inserted into LocationID in Destination table
Normally If one Location was available I would have inserted, but I need to insert both the Records into Destination by mapping them to Mapping table
if one Location Was Available:
Insert Into DestinationTable
(LocationID)
Select M.LocationID From MappingTable M Join Sourcetable S Where M.location = S.ALocation
This would Output
Destination Table
LocationID
1
But I want to see this as
Destination Table
LocationID
1
2
Please Help on this.
Thanks
Thanks, Please Help People When they need..!!! Mark as answered if your problem is solved.