Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rearrange data with t-sql

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a data like this

Customer_DayPart_Morning__Day_Evening

John______1_______5:50
John______2______________13:20
John______3___________________18:50
Paul______2______________13:50
Paul______2______________14:20
Paul______3___________________19:20
Bob_______1________3:20
Bob_______1________4:15

How through sql I can rearrange the data in order to get this:

Customer_Morning_Day___Evening

John______5:50___13:20__18:50
Paul_____________13:50__19:20
Paul_____________14:20
Bob ______3:20
Bob ______4:15

Thanks
 
You have a problem with your table schema. I am not sure this is possible with the way your table is designed.

Consider the following data:
John______1_______5:50
John______2______________13:20
John______3___________________18:50
Paul______2______________13:50
Paul______2______________14:20
Paul______3___________________19:20
Bob_______1________3:20
Bob_______1________4:15

I added
John______1_______7:50
John______1_______10:50

How do you expect to this data to be displayed, I mean the relation.

I don't know if anyone else has any ideas.... Anybody out there???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top