Have a problem find a query for my tables
I have 2 tables tab table1 and table2 as follow
table1
id (int) auto_increment
table2_id1(int)
table2_id2(int)
table2_id3(int)
table2_id4(int)
table2
id(int) auto
name (varchar)
that I will do is to get a query to show the name for table2.name insted of the table2_id1 integer.
exampel what I will do and havent a query for
1....test...test...test...test
2....mos...test...mos...mos
my tables as follow
Table1
1 1 1 1 1
2 2 1 2 2
table2
1 test
2 mos
hope that you can understand what I trying to do, probably some easy way to get the result but I cant find it. Im glad of all help I can get.
You need to join to table2 with an alias, 4 different times, please note that as Mike points out, this is not a very good structure, and you are better off creating a different table to handle this one-to-many relation, instead of adding columns on table 1