2024-09-12 08:56:20
2024-09-12 00:38:19
就写个sql语句打印出来我想要的那样就行
create table #table([date] nvarchar(50),number nvarchar(500))
insert into #table values('2014/12/31','5436144.3')
insert into #table values('2014/12/31','187056.81')
insert into #table values('2014/12/31','1274795.57')
---------------------------------------------------------------
select distinct [date] as FDate,
STUFF((select ' '+number from #table for xml path('')),1,1,'') as FZqsz
from #table
这样?
2024-09-12 01:20:57
2024-09-12 01:36:46
显示成:2014/12/31 5436144.3 187056.81 1274795.57
用 CASE WHEN
能给个sql吗
SELECT F.FDATE , MAX(F.FD1) "应付受托费" , MAX(F.FD2) "应付投资管理费",MAX(F.FD3) "应付托管费" FROM (
SELECT FDATE FDATE ,
(CASE WHEN FNAME = '应付受托费' THEN FD END) FD1 ,
(CASE WHEN FNAME = '应付投资管理费' THEN FD END) FD2 ,
(CASE WHEN FNAME = '应付托管费' THEN FD END) FD3
FROM TT
WHERE FDATE = '2014/12/31') F
GROUP BY F.FDATE