一个table得出以下结果
field
c
h
i
l
d我想得到
field0
child这样的结果
field
c
h
i
l
d我想得到
field0
child这样的结果
解决方案 »
- 【收到日期】加上(1到5)的随机数得到【收到日期1】的sql语句怎么写?
- 为什么我的sql server 2005开发版装不上xp sp2啊
- 为空的字段让它显示为1,怎么写
- 左外连接、再分组、再加一个条件,这语句要如何写,请各位高手赐教!
- 问一个数据库结构设计的问题.
- update 触发器??
- 循环问题,使用游标过慢,有啥好方法?
- 同一张表中有3列不能同时为空
- 创建数据库产生置疑,这是怎么回事???
- 请教:为何'MSDASQL' 无法启动分布式事务。
- 请帮忙解决sql的问题 -给100分
- SQL SERVER服务器按照默认方式配置成发布和分发服务器 问题sos~~~~~~~~~~~~~~~~~~~~~~~~~~~``
insert into tb select 'c'
union all select 'h'
union all select 'i'
union all select 'l'
union all select 'd'select * from tbdeclare @s varchar(100)
set @s=''
select @s=@s+field from tb
select @s as fielddrop table tb
go
create function testfunc() returns varchar(100)
as
begin
declare @s varchar(100)
set @s = ''
select @s = @s + field
from tablename
return(@s)
end
go
select dbo.testfunc()
drop function testfunc
declare @vStr nvarchar(2000)
set @vStr=''
select @vStr=@vStr+field
from TableName