Concatenating Column Values into a Comma-Separated List

Detection score: 4.5

<p>DECLARE @listStr VARCHAR(MAX)
SELECT @listStr = COALESCE(@listStr+',' , '') + CarName
FROM Cars
SELECT @listStr</p>
Posted 13 days ago | reported 13 days ago
Posted by Rahul Srivastava (11)

Caught by 4 reasons: