从sql plus中的字符串中删除最后一个字符 [英] Remove last character from string in sql plus

查看:31
本文介绍了从sql plus中的字符串中删除最后一个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从 sql plus 的列输出中删除最后一个字符.列条目的长度不固定

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

例如 XYZA 应该输出为 XYZ

For e.g XYZA should output as XYZ

我尝试过使用 substr() 函数,但它似乎不起作用.

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

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

推荐答案

右括号在错误的位置.应该是:

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

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

这篇关于从sql plus中的字符串中删除最后一个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆