MySQL Forums
Forum List  »  Newbie

Moving records up onto 1 line
Posted by: Penny Barrett
Date: September 24, 2015 07:48AM

This is a small example of all appointments for 1 unique UID number running vertically in the database. I need a MYSQL command to move all data up on to 1 line based off the UID number; creating a time line for the appointments.

Database looks like:
UID DATE WEIGHT
1 02/03/04 50
1 03/04/06 60
1 04/05/07 70
2 07/08/09 80
2 09/10/11 100
5 17/02/03 150
5 30/02/05 130
5 12/04/14 80
5 11/02/15 90
The way I need the above data to look for querying purposes is: (drop the UID# when moved up)

UID DATE1 WEIGHT1 DATE2 WEIGHT2 DATE3 WEIGHT3 DATE4 WEIGHT4
1 02/03/04 50 03/04/06 60 04/05/07 70
2 07/08/09 80 09/10/11 100
5 17/02/03 130 30/05/05 80 12/04/14 80 11/02/15 90
This is a very small example as I work with thousands of records with up to 56 variables.
Does anyone have any ideas?

Thanks for your time
Penny

Options: ReplyQuote


Subject
Written By
Posted
Moving records up onto 1 line
September 24, 2015 07:48AM


Sorry, you can't reply to this topic. It has been closed.

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.