Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys
I have 2 tables. On has got the following fields: Third Party, Group.
The other has got the following fields: Marine, PC
How do I get to merge these two tables so that it displays for example: Third Party Marine or Group PC.
Thanks
You then need to join the two tables over the ItemCode field (which could be seen as the primary key in this case). Pay attention to the relationship between the three tables or you will end up with a Cartesian product. You should have a relationship that is one-to-many-to-one between the three tables (with the ItemCode field linking the two other tables together). So it could be something like:
Load PC, Marine, ItemCode From table1;
JOIN
Load ItemCode From table2;
JOIN
Load ItemCode, Third Party, Group From table3;
Depending on the result you want you might need to do LEFT/RIGHT joins.
Based on your post, it isn't clear if there is any relation between these two tables.. it doesn't sound like there is, though. You can force the two to be joined by adding a JOIN keyword between the two LOADs - but this will result in a cartesian join, which may not be what you want.
Note that there is a relation between the two tables. Both are linked to an ItemCode.
If I select an ItemCode I get either PC/Marine in the one table & Third Party/Group in the other table.
You then need to join the two tables over the ItemCode field (which could be seen as the primary key in this case). Pay attention to the relationship between the three tables or you will end up with a Cartesian product. You should have a relationship that is one-to-many-to-one between the three tables (with the ItemCode field linking the two other tables together). So it could be something like:
Load PC, Marine, ItemCode From table1;
JOIN
Load ItemCode From table2;
JOIN
Load ItemCode, Third Party, Group From table3;
Depending on the result you want you might need to do LEFT/RIGHT joins.