Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Concatenate Column
Message
 
 
To
21/02/2003 20:33:04
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00756491
Message ID:
00756501
Views:
12
>Hi all
>
>Is there any way with SQL Server and SPT to concatenate a set of entries into a string much as SUM() sums a set of entries into a total?

Mike,
There's set based solution if you want to concatenate column from all records that satisfy query conditions.
TEXT TO lcSql NOSHOW
DECLARE @StrConcat varchar(8000)
SET @StrConcat = ''
SELECT  @StrConcat =  @StrConcat + ', ' + title_id
	FROM pubs..sales
	WHERE stor_id LIKE '7%'
SELECT SUBSTRING(@StrConcat,3,8000)
ENDTEXT
? SqlExec(lnConn, lcSql)
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform