Home > Software design >  How to substring from a certian index to the end in SQL
How to substring from a certian index to the end in SQL

Time:05-27

I want to get the substring from e.g. START=3 to the end of the string.

Str
stringExample
anotherStringExample

I need something like this:

SUBSTR(str, 3, `**end**`)

and the output should be:

Str
ringExample
otherStringExample

CodePudding user response:

You can try this query

select SUBSTR(Str,3,LENGTH(Str)-3 1) as Str;

or

select SUBSTR(Str,3) as Str;

substr function w3schools link

  • Related