How to delete last character Oracle
Hi I have a list of data that I was preparing to import as a 'Number'
However the data I recieved had a String at the end of the number.
Example: 350 M, 25 M
How should I delete the character 'M' and maybe any empty space.
You can combine the SUBSTR and LENGTH functions like this:
select SUBSTR('350 M', 0, LENGTH('350 M') - 1) from dual;
(or -2 if you want to remove the space also)
I think you need to get exactly the number, so I think it is easier to do with a regular expression:
select regexp_substr('350 M','^[0-9]+') from dual;
Maybe it does not answer your current question but should solve your problem on another level.