读书人

函数解决方法

发布时间: 2011-12-26 23:09:58 作者: rapoo

函数
有没有什么函数可以去掉一个表中某列下的所有数据的最后一个字符啊?

[解决办法]

--更新
Update TableName Set ColName = Left(ColName, Len(ColName) - 1)
--查
Select Left(ColName, Len(ColName) - 1) As ColName From TableName
[解决办法]
1
update tb
set col = left(col,len(col)-1)
2
update tb
set col = substring(col,1,len(col)-1)
3
update tb
set col = stuff(col,len(col)-1,1, ' ')

读书人网 >SQL Server

热点推荐