📜  sql代码示例中的1列值到1个单行

📅  最后修改于: 2022-03-11 15:05:13.098000             🧑  作者: Mango

代码示例1
DECLARE @combinedString VARCHAR(MAX)
SELECT @combinedString = COALESCE(@combinedString + ', ', '') + column_name
FROM table_name
WHERE ID = 1234

SELECT @combinedString as StringValue