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 2 months ago | reported 2 months ago
Posted by Rahul Srivastava (11)

Caught by 4 reasons: