MS-SQL DECLARE 관련 여러 로우 텍스트 붙이기

DECLARE @Authors VARCHAR(8000)
SET @Authors = ''
DECLARE @co_no INTEGER
SET @co_no = ''

UPDATE #REQMEMO
SET @Authors = xName = CASE
WHEN @co_no = Cno THEN @Authors + ', ' + xName
ELSE xName END,
@co_no = Cno

DECLARE @Authors VARCHAR(8000)
SET @Authors = ''
DECLARE @co_no INTEGER
SET @co_no = ''

UPDATE #REPMEMO
SET @Authors = xName = CASE
WHEN @co_no = Cno THEN @Authors + ', ' + xName
ELSE xName END,
@co_no = Cno


SELECT Cno, MAX(xName)
FROM #REQMEMO WHERE CNO ='82105'
GROUP BY Cno ;

SELECT Cno, MAX(xName)
FROM #REPMEMO WHERE CNO ='82105'
GROUP BY Cno ;

댓글

가장 많이 본 글