Wednesday, 4 January 2012

MySQL substring

MySQL SUBSTRING() returns a specified number of characters from a particular position of a given string.

Syntax

SUBSTRING(str, pos, len)
 

Example

SELECT SUBSTRING('w3resource',4,3);

Explanation

The above MySQL statement returns 3 numbers of characters from the 4th position of the string ‘w3resource’.

Output

MySQL SUBSTRING()
 

No comments:

Post a Comment