去除编码字段前后包含的空格

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

去除编码字段前后包含的空格

--查询是否存在空格字段。

SELECT a.FNUMBER as '编码', b.FDATAVALUE as '名称',c.FNAME as '创建人',d.FNAME as '审核人'

FROM T_BAS_ASSISTANTDATAENTRY a

LEFT JOIN T_BAS_ASSISTANTDATAENTRY_L b

ON a.FENTRYID = b.FENTRYID

AND b.FLOCALEID = 2052

LEFT JOIN T_SEC_user c

on a.FCREATORID = c.FUSERID

LEFT JOIN T_SEC_user d

on a.FAPPROVERID = d.FUSERID

WHERE a.FID = '5cbfb58966b446' --辅助资料类型内码 规格

AND a.FDOCUMENTSTATUS = 'C'

AND a.FFORBIDSTATUS = 'A'

AND (LEFT(a.FNUMBER,1) = '' OR RIGHT(a.FNUMBER,1) = '')

--去除空格

update  T_BAS_ASSISTANTDATAENTRY set FNUMBER = RTRIM(LTRIM(FNUMBER)) from T_BAS_ASSISTANTDATAENTRY a LEFT JOIN T_BAS_ASSISTANTDATAENTRY_L b

ON a.FENTRYID = b.FENTRYID

AND b.FLOCALEID = 2052

LEFT JOIN T_SEC_user c

on a.FCREATORID = c.FUSERID

LEFT JOIN T_SEC_user d

on a.FAPPROVERID = d.FUSERID

WHERE a.FID = '5cbfb58966b446' --辅助资料类型内码 规格

AND a.FDOCUMENTSTATUS = 'C'

AND a.FFORBIDSTATUS = 'A'

AND (LEFT(a.FNUMBER,1) = '' OR RIGHT(a.FNUMBER,1) = '')


去除编码字段前后包含的空格

--查询是否存在空格字段。SELECT a.FNUMBER as '编码', b.FDATAVALUE as '名称',c.FNAME as '创建人',d.FNAME as '审核人'FROM ...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息