0
我在写下面的SQL查询来替换双重空间。但它给错误。谁能帮忙?SQL替换函数不起作用
下面的代码: -
Select *
From (
select nvcFormName,iEvalID,iFormID,dtCreationTime,dtEvaluatedStartTime,
fltGradScore,nvcFormattedName,iEvaluatorUserID,
iAgentUserID,flScore,iQuestionID,nvcQuestionAnswer
from dbo.vwEvaluationQuestions
inner join dbo.vwUser on iUserId = iAgentUserID where iFormID = 160
) as s
Pivot (min(nvcQuestionAnswer) for iQuestionID in ([23732], replace([23742],' ','')) as pvt
where dtEvaluatedStartTime > '2017-04-01' and dtEvaluatedStartTime < '2017-04-30'
order by dtEvaluatedStartTime asc
什么错误? – Moudiz
我认为替换([23742],'','')是你问题的一部分。您试图替换字符串[23742]中不包含任何空格的双重空格。我认为你需要用你想替换空格的列替换硬编码值... –
@Neil Hibbert我认为[23742]是他的专栏名称 – Nithin