Home > Software engineering >  SQL substring starting at x character
SQL substring starting at x character

Time:03-19

Is there a way to use substring in SQL that extracts to letters after the first two letters from the left?

For example for the word Apple the substring should extract pl or for word Exchange, ch would be extracted.

CodePudding user response:

SELECT SUBSTRING('Apple', 3, 2);

SUBSTRING(string, start, length)

CodePudding user response:

For MySQL Syntax:

SELECT SUBSTRING("String", starting position, no of characters) 
SELECT SUBSTRING("Apple", 3, 2) ;

Result

pl
  • Related