MySQL RIGHT Function

Example

Extract 4 characters from a string (starting from right):

SELECT RIGHT("SQL Tutorial is cool", 4) AS ExtractString;

Definition and Usage

The RIGHT() function extracts a number of characters from a string (starting from right).

Tip: Also look at the LEFT() function. Continue reading MySQL RIGHT Function

MySQL LEFT Function

Example

Extract 3 characters from a string (starting from left):

SELECT LEFT("SQL Tutorial", 3) AS ExtractString;

Definition and Usage

The LEFT() function extracts a number of characters from a string (starting from left).

Tip: Also look at the RIGHT() function. Continue reading MySQL LEFT Function