SQL Server 字符串截取

原文:https://blog.csdn.net/lanxingbudui/article/details/87979290



效果1

select RIGHT('SqlServer_2008', 3)



效果2

select RIGHT('SqlServer_2008', LEN('SqlServer_2008')-3)

实际使用

UPDATE dbo.Projects
SET ProjectCode = RIGHT(ProjectCode, LEN(ProjectCode)-6)

效果

还有一个树的层级,降级处理

UPDATE dbo.Projects
SET [Level] = [Level] - 2

效果

posted @ 2020-09-24 14:08  古兴越  阅读(243)  评论(0编辑  收藏  举报