I’m having some trouble while transposing some table rows into columns based on joins using MySQL. I know it’s a database issue, but maybe someone could give me an alternative solution.
Given the following two tables:
INVOICES
COLUMNS
I need to output this table:
Basically, on the first table I save the information of different invoices and the ID of the column where the Total of each invoice should be shown. On the second table I’m saving the different columns I have. The query should be dynamic, so if I create new columns on the second table I wouldn’t have to update my query.