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 |
|
srxr9
Starting Member
15 Posts |
Posted - 2006-09-26 : 09:55:09
|
| How do I get the values of a column from a table separated by a comma.For exampleSuppose I have a table with column Levels (below), I want the values of the corresponding column separated by a comma, so that I can use this in a different query to pull these values from a different tableLevelsLevel1NameLevel1ValueLevel2NameLevel2ValueResult should look likeLevel1Name, Level1Value, Level2Name, Level2ValueThanksSuresh |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-26 : 10:11:52
|
| There are hundreds of examples here at SQLTeam with concatenating functions.Peter LarssonHelsingborg, Sweden |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2006-09-26 : 10:16:00
|
| Perhaps you should just ask about what you want as an end result. It sounds like you are doing needless things.[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-09-26 : 11:17:48
|
| "so that I can use this in a different query"How are you planning to use this in your other query? I reckon there are better ways to do this can concatenating the Levels - explain your product, not your proposed solution!, and then see what folk here can come up with.Kristen |
 |
|
|
|
|
|