Remove last character from string in sql plus

陌路散爱 提交于 2020-06-25 07:38:05

问题


I'm trying to remove the last character from a column output in sql plus. The length of the column entries is not fixed

For e.g XYZA should output as XYZ

I've tried using the substr() function but it doesn't seem to work.

SUBSTR(ooo.CO_NAME,1,LENGTH(ooo.CO_NAME-1))

回答1:


A closing parenthesis is in the wrong place. It should be:

SUBSTR(ooo.CO_NAME, 1, LENGTH(ooo.CO_NAME) - 1)


来源:https://stackoverflow.com/questions/26465848/remove-last-character-from-string-in-sql-plus

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!