_mastermind_ Posted October 13, 2004 Share Posted October 13, 2004 I have an hard question for you :) With a query i made a table like this: Colum1 | Column 2 x | y x | z x | h r | y r | z w | y w | h now i want to transform this table in something like this: x | y,z,h r | y,z w | y,h Anyone can give me some ideas? Thank you very much. Link to comment Share on other sites More sharing options...
0 Mouton Posted October 13, 2004 Share Posted October 13, 2004 I have my doubts about this being possible without a scripting language. Link to comment Share on other sites More sharing options...
0 _mastermind_ Posted October 13, 2004 Author Share Posted October 13, 2004 i can use a stored procedure in t-sql Link to comment Share on other sites More sharing options...
0 MrRogers Posted October 14, 2004 Share Posted October 14, 2004 use a temp table? Link to comment Share on other sites More sharing options...
0 Mouton Posted October 14, 2004 Share Posted October 14, 2004 use a temp table? And how would u do that using a temp table ? Link to comment Share on other sites More sharing options...
0 jamend Posted October 14, 2004 Share Posted October 14, 2004 Does it have to be in-line? Link to comment Share on other sites More sharing options...
0 _mastermind_ Posted October 14, 2004 Author Share Posted October 14, 2004 done it :D :D i have to use cursors and temporaney tables. Link to comment Share on other sites More sharing options...
0 azcodemonkey Posted October 14, 2004 Share Posted October 14, 2004 done it :D :D i have to use cursors and temporaney tables. 584733776[/snapback] I see you're gearing it for performance. ;) Link to comment Share on other sites More sharing options...
0 _mastermind_ Posted October 14, 2004 Author Share Posted October 14, 2004 lol I know that cursors are not well for sql server, but the page that need that stored procedure is loaded rarely so i can use it :D Link to comment Share on other sites More sharing options...
Question
_mastermind_
I have an hard question for you :)
With a query i made a table like this:
Colum1 | Column 2
x | y
x | z
x | h
r | y
r | z
w | y
w | h
now i want to transform this table in something like this:
x | y,z,h
r | y,z
w | y,h
Anyone can give me some ideas?
Thank you very much.
Link to comment
Share on other sites
8 answers to this question
Recommended Posts