去除编码字段前后包含的空格
--查询是否存在空格字段。
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) = '')
去除编码字段前后包含的空格
本文2024-09-16 17:18:29发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-14863.html