In this guide, we will explain how to use the MySQL REVERSE function with syntax and examples.
Description
The REVERSE function returns a string with the characters in reverse order.
Syntax
The syntax for the REVERSE function in MySQL is:
REVERSE( string )
Parameters or Arguments
string
The source string whose characters are to be reversed.
Note
- The REVERSE function is safe to use with multi-bytes.
Applies To
The REVERSE function can be used in the following versions of :
- MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23
Example
Let’s look at some REVERSE function examples and explore how to use the REVERSE function.
For example:
mysql> SELECT REVERSE('adglob.in'); Result: 'ni.bolgda' mysql> SELECT REVERSE('abcde'); Result: 'edcba' mysql> SELECT REVERSE('123'); Result: '321' mysql> SELECT REVERSE(123); Result: '321'
Next Topic : Click Here
Pingback: MySQL: REPLACE Function | Adglob Infosystem Pvt Ltd