Internet Sellout

Demand Unearned Rewards

Aggregate Concatenate String TSQL

There are a few ways to sodomize this baboon. This way is working out for me:

CREATE TABLE #BUYER (Buyer varchar(10),Class varchar(10))
INSERT INTO #BUYER (Buyer,Class) VALUES ('Ashley','AAA')
INSERT INTO #BUYER (Buyer,Class) VALUES ('Ashley','BBB')
INSERT INTO #BUYER (Buyer,Class) VALUES ('Ashley','CCC')
INSERT INTO #BUYER (Buyer,Class) VALUES ('Frank','CCC')

 

SELECT B1.Buyer,
STUFF(
(
SELECT ',' + B2.Class
FROM #BUYER B2
WHERE B2.Buyer = B1.Buyer
FOR XML PATH('')
), 1, 1, '') as Classes
FROM #BUYER B1
GROUP BY B1.Buyer

DROP TABLE #BUYER

In the Name of Food

There is a new place ins Santa Cruz by the Metro downtown, Betty's Noodle House, that is really rocking hard:

https://www.facebook.com/BettysNoodleHouse

 

Comments are closed