MySQL Forums
Forum List  »  Newbie

Display Column Data in Rows
Posted by: Steve Royle
Date: November 18, 2018 06:53AM

I have a data source that has various columns with data fields like this.

Name Add Town Field A Field B Field C
Steven Mill St Holburn 3 2 6
Paul Church Rd Stretton 10 7 6

And I want to run a query to display like this

Name Add Town Field Field Value
Steven Mill St Holburn A 3
Steven Mill St Holburn B 2
Steven Mill St Holburn C 6
Paul Church Rd Stretton A 10
Paul Church Rd Stretton B 7
Paul Church Rd Stretton C 6

Can anyone suggest the correct code so that the 2 rows of data in the first section becomes 6 rows of data in the second section.

Many thanks

Options: ReplyQuote

Written By
Display Column Data in Rows
November 18, 2018 06:53AM

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.