Forum Discussion
Merging two unrelated tables
Is it possible to merge two unrelated tables together
Say for instance I have a Date table, with one column and three rows
Date
1-Jan-15
1-Feb-15
1-Mar-15
The I also have a Names table, with one column and three rows
Name
Rod
Jane
Freddie
Is it possible to create a DateName table, , with two columns and nine rows?
Date.........Name
1-Jan-15...Rod
1-Feb-15...Rod
1-Mar-15...Rod
1-Jan-15...Jane
1-Feb-15...Jane
1-Mar-15...Jane
1-Jan-15...Freddie
1-Feb-15...Freddie
1-Mar-15...Freddie
Thanks in advance
Lee
- Anonymous10 years ago
Hello Lee_Mather
Yes you can do this in the Query Modeler, but you'll have to modifiy the structure of the tables in order to create a surrogate key" to mege the table.
In the table, you add a new column (SK for example) with the value "1" for all the record.
You do the same with the other table, and now you can merge the two queries, based on this fake relationship. Don't forget to check the relationship type with "full external" and it should be ok.
Sébasttien
6 Replies
- AnonymousNot applicable
Hello Lee_Mather
Yes you can do this in the Query Modeler, but you'll have to modifiy the structure of the tables in order to create a surrogate key" to mege the table.
In the table, you add a new column (SK for example) with the value "1" for all the record.
You do the same with the other table, and now you can merge the two queries, based on this fake relationship. Don't forget to check the relationship type with "full external" and it should be ok.
Sébasttien
- Lee_MatherRegular Visitor
thanks loads, makes perfect sense
ta
Lee
- AnonymousNot applicable
3) Select the columns to display
4) Select and merge the columns
- AnonymousNot applicable
Great solution Anonymous!
p.s. For other users that may need help on this purpose here is the solution explained:
1) Add to the two tables the same "index column" with a fixed index
2) Merge the two tables