📅  最后修改于: 2022-03-11 14:48:16.503000             🧑  作者: Mango
DECLARE @csv VARCHAR(MAX)
SELECT @csv = COALESCE(@csv + ',' ,'') + book_title from Test.dbo.Books where book_id IN ( 101, 102, 103);
SELECT @csv
Output
Head First SQL, SQL Puzzler, T-SQL Fundamentals