declare @id varchar(500);
set @id=''
select @id =@id+( convert(varchar,business_event_id) +',')
from bem.business_event_header substring
print @id
我不想在最后一个号码后面写逗号。
答案 0 :(得分:0)
试试这个:
DECLARE @id VARCHAR(500);
SET @id = '';
SELECT @id = @id+(CONVERT( VARCHAR, business_event_id)+',')
FROM bem.business_event_header substring;
SELECT @id = SUBSTRING(@id, 1, CHAR_LENGTH
(@id)-1);
PRINT @id;