Jump to: navigation, search

Mysql RIGHT

From w3cyberlearnings

Contents

MySQL RIGHT Function

This function returns a substring based on the right side of a given string.

Syntax RIGHT

  • Str: String input
  • Length: Length to be return (count from the right side or from the last to the beginning)
RIGHT(Str,length);

Example 1

mysql> SELECT RIGHT('good girl',5);
+----------------------+
| RIGHT('good girl',5) |
+----------------------+
|  girl                |
+----------------------+
1 row in set (0.00 sec)

Example 2

mysql> SELECT RIGHT('will',3);
+-----------------+
| RIGHT('will',3) |
+-----------------+
| ill             |
+-----------------+
1 row in set (0.00 sec)

Related Links


Navigation
Web
SQL
MISC
References