I have two SQL Server tables that are not linked together (No join) and I want to get the data from the second table based on the data of the first table. In the first table I have this:
Table 1
id name ---------- 4 BOX-A 8 PART-D Table 2
id name ------------ 14 BOX-A1 25 BOX-A2 38 TOOL-A1 39 TOOL-A2 40 PART-D1 41 PART-D2 What I want to do is that for each name found in table 1, I want to return all the matches in the table 2, so at the end I will have something like this:
id name ----------- 14 BOX-A1 25 BOX-A2 40 PART-D1 41 PART-D2