SQL SERVER 撈出資料列的值串成一行文字

declare @s nvarchar(4000)
select @s=isnull(@s+’;’ , ”)+ cast(resal001 as nvarchar)
from resal
where substring(resal001,1,1) in (‘C’,’E’,’H’,’I’,’J’,’R’)
and resal001 not in (‘CSB’,’H90′)
print @s

by mhchen15 on 19 3 月, 2014 in SQL SERVER - Tags:
Tags:

There are no comments.

Name*: Website: E-Mail*:
XHTML: You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>