8

I have Table1.column1 in a Oracle Server with text such as 12345678910.

How can I remove the first six characters of the string? The result should be 78910.

2

3 Answers 3

16
SELECT SUBSTR( column1, 7, LENGTH( column1 ) - 6 )
FROM   Table1;

or more simply:

SELECT SUBSTR( column1, 7 )
FROM   Table1;
Sign up to request clarification or add additional context in comments.

Comments

6

If you know you want the last five characters of a string you can use a negative value for the second argument to SUBSTR, as in:

select substr('12345678910', -5) from dual;

which produces '78910'.

Best of luck.

Comments

1

Have you tried using SUBSTR() function like

select substr(column1, 6, 5)
from Table1;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.