2 u011134641 u011134641 于 2016.05.06 15:24 提问

数据库查询问题,求大神帮忙解决

图片说明

4个回答

CSDNXIAON
CSDNXIAON   2016.05.06 15:32

用的vs2005,这怎么解决呢,求大神帮忙
关于windows 2008 server R2 文件共享问题,求大神帮忙解决一下!
求大神帮忙关于Openssl实现TLS通信的问题
----------------------同志你好,我是CSDN问答机器人小N,奉组织之命为你提供参考答案,编程尚未成功,同志仍需努力!

qch2006qch
qch2006qch   2016.05.06 15:47

declare @tb table
(
BQMC varchar(50),
NR varchar(10)
)

insert into @tb values('cpts', 'lalala')
insert into @tb values('cpts', 'huahuahua')
insert into @tb values('fwnr', '123456')
insert into @tb values('fwnr', '789')

select BQMC, ep_name = (stuff((select ',' + NR from @tb where BQMC =

a.BQMC for xml path('')),1,1,'')) from @tb a group by BQMC


qch2006qch
qch2006qch   2016.05.06 15:48
 declare @tb table
(
BQMC varchar(50),
NR   varchar(10)
)

insert into @tb values('cpts', 'lalala')
insert into @tb values('cpts', 'huahuahua')
insert into @tb values('fwnr', '123456')
insert into @tb values('fwnr', '789')

select BQMC, ep_name = (stuff((select ',' + NR from @tb where BQMC =   
    a.BQMC for xml path('')),1,1,'')) from @tb a group by BQMC  

strutce
strutce   Ds   Rxr 2016.05.06 16:28

ORACLE数据库写法SELECT BQMC || '|' || replace(WMSYS.WM_CONCAT(NR),',',';' ) AS AA FROM TABLE_t1 GROUP BY BQMC

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!