I have three tables. Each one has three columns. It looks like this:
table 1 table 2 table 3 -------------------- -------------------- -------------------- col1 col2 colA col1 col2 colB col1 col2 colC 1 A data 3 C data 5 E data 2 B data 2 B data 6 F data 3 C data 1 A data 3 C data 4 D data 4 D data 2 B data 5 E data 6 F data 1 A data 6 F data 5 E data 3 C data
My question is if it is at all possible with JOINS to output something like this:
output table ----------------------------------------- col1 col2 colA colB colC 1 A data data data 2 B data data data 3 C data data data 4 D data data data 5 E data data data 6 F data data data
Note that Col1 and Col2 always have the same values in the different columns but are in different order.
I don't even know if this is possible but ideally the query would join the three tables and relate the information on col1 and col2 with each respective table and reorder the two joining tables and output a single table/array.
Let me know if this is really stupid or complex... I've been trying to wrap my head around this but by mySql knowledge is very limited.