Remove last character from string in sql plus

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

For example, XYZA should be displayed as XYZ

I tried using the substr() function, but it does not work.

 SUBSTR(ooo.CO_NAME,1,LENGTH(ooo.CO_NAME-1)) 
+5
source share
1 answer

The closing bracket is in the wrong place. It should be:

 SUBSTR(ooo.CO_NAME, 1, LENGTH(ooo.CO_NAME) - 1) 
+16
source

Source: https://habr.com/ru/post/1205090/


All Articles