Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Nahymt
Starting Member
2 Posts |
Posted - 2010-08-30 : 23:45:33
|
Hi, I'm new here. I need to combine several rows and columns into one row.vp_assistant_schedule:AssistantID, DayID, ShiftIDFor example I have:AstA, 1, 1AstA, 1, 2AstA, 3, 1I need to display it as:AstA, Day 1 7.00-9.00, 9.00-11.00; Day 3 7.00-9.00or if that's too hard at leastAstA, Day 1 7.00-9.00, Day 1 9.00-11.00, Day 3 7.00-9.00So far I only have it look as:AstA, Day 1 7.00-9.00AstA, Day 1 9.00-11.00AstA, Day 3 7.00-9.00How do I combine these based on each AssistantID? And the database is located on the a server where I can't create any proc or table at all. Thanks |
|
Nahymt
Starting Member
2 Posts |
Posted - 2010-08-31 : 01:48:57
|
Already solved it, I imported my query as a new table into my local database and then created a function with coalesce to do it. |
|
|
|
|
|
|
|