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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Recordset Combination Question

Author  Topic 

Krilyn
Starting Member

7 Posts

Posted - 2008-04-10 : 16:00:51
I was asked this question and I was wondering if it was possible.

You have a table A with the column B and within that column you have values 1,2,3,4 & 5.

I was wondering if there was a way to return all off the values within the column in one recordset. So your selection would return

Return Column
1,2,3,4,5

Thank you in advance for any help with this issue.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-10 : 16:06:20
SELECT REPLACE(Col1, ' & ', ',')
FROM Table1



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2008-04-10 : 17:37:32
lol Peso

Here's an 'alternative'...

declare @A table (B int)
insert @A select 1 union select 2 union select 3 union select 4 union select 5

declare @v varchar(10)
select @v = isnull(@v + ',', '') + cast(B as varchar(5)) from @A
select @v


Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-11 : 05:44:11
If you use front end application to shjow data, do this concatenation there

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -