Forgive me if this question has been asked and answered, I\'ve searched and found a few that look similar but I\'m too much of a novice with SQL to adapt them to my needs. A
The output you're asking for is not a relation, since its attributes don't have unique names. So it's unreasonable to expect a relational database system to produce such a result. Which is not to say that some database systems can break the relational model and produce non-relational results in some cases; but this isn't likely to be one of them.
So you should instead have the application take the relation as input and transform it to the output you want. From the RDBMS perspective, that's a major part of the role of the application.