为sql中的每一列添加逗号以使其分隔

g6ll5ycj  于 2021-07-24  发布在  Java
关注(0)|答案(1)|浏览(559)

我可以问一下下面的sql,有没有一种方法可以为结果的每一列添加一个逗号。非常感谢你

SELECT convert(nvarchar(16) , fcp.ServicePointID) as ServicePointID 
      , convert(nvarchar(15), fcp.ChannelNumber) as channelNumber
      , convert(nvarchar(20), recordingdevice.recordingdeviceid) as RecordingDeviceID
      , RegisterReading.DataValue as DataValue
      , convert(nvarchar(25), dateadd(hh, 8, RegisterReading.EndTime), 120)  as EndTime
      , convert(nvarchar(25), dateadd(hh, 8, ReadingGroup.ReceivedTime), 120)  as ReceivedTime
  FROM RegisterReading (nolock)



servicepointid通道号1、098、2、099、3、010,

d7v8vwbk

d7v8vwbk1#

对于每列:concat(convert(nvarchar(16),column),',')as columnalias

相关问题