Hey,
I am trying to turn around the output of a database I have.
The dates need to be dynamic as new dates will pop up in the database.
As I understood it, there is a function called PIVOT in SQL Server 2005+ but I can´t seem to find a solution to it in MYSQL 5.6.
Is there anyone out there who can give me a helping hand?
Many thanks in advance!!
How the db looks like:
[table]
[tr]
[td]DATE[/td]
[td]1_ABR[/td]
[td]2_ASA[/td]
[/tr]
[tr]
[td]2015-01-01[/td]
[td]15[/td]
[td]29[/td]
[/tr]
[tr]
[td]2015-01-02[/td]
[td]11[/td]
[td]20[/td]
[/tr]
[tr]
[td]2015-01-03[/td]
[td]16[/td]
[td]21[/td]
[/tr]
[/table]
Output:
[table]
[tr]
[td] [/td]
[td]2015-01-01[/td]
[td]2015-01-02[/td]
[td]2015-01-03[/td]
[/tr]
[tr]
[td]1_ABR[/td]
[td]15[/td]
[td]11[/td]
[td]16[/td]
[/tr][tr]
[td]2_ASA[/td]
[td]29[/td]
[td]20[/td]
[td]21[/td]
[/tr]
[/table]