Skip to content

Commit 9f641d5

Browse files
authored
quotename function
accumulating column values into a variable
1 parent 1dea5f4 commit 9f641d5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--select top 10 * from [dbo].[Sample_Superstore]
2+
3+
--Customer_ID
4+
--Segment
5+
6+
7+
DECLARE @custid as varchar(max);
8+
9+
set @custid = ' ';
10+
11+
select @custid = @custid + Customer_ID
12+
+ char(10)
13+
from Sample_Superstore
14+
where Segment = 'Consumer'
15+
order by Customer_ID
16+
17+
--select @custid as customer_id
18+
19+
PRINT(@custid)

0 commit comments

Comments
 (0)