SELECT REPLACE(MaterialCode, CHAR(13) + CHAR(10), ''),REPLACE(MaterialCode, CHAR(13), ''),REPLACE(MaterialCode, CHAR(10), '')
FROM #MeetingPlan2023 where isnull(MaterialCode,'')!=''
and ID=22264
SELECT REPLACE(MaterialCode, CHAR(13) + CHAR(10), ''),REPLACE(MaterialCode, CHAR(13), ''),REPLACE(MaterialCode, CHAR(10), '')
FROM #MeetingPlan2023 where isnull(MaterialCode,'')!=''
and ID=22264
--有效
SELECT REPLACE(MaterialCode, CHAR(13) + CHAR(10), ''),REPLACE(MaterialCode, CHAR(13), ''),REPLACE(MaterialCode, CHAR(10), '')
FROM #MeetingPlan2023 where isnull(MaterialCode,'')!=''
and ID=22264
示例:
标签:10,13,换行,MaterialCode,Excel,sqlserver,REPLACE,CHAR,where From: https://www.cnblogs.com/wzzcc/p/17956458