This tutorial explains how to use the MySQL REVERSE function with syntax and examples.
The MySQL REVERSE function returns a string with the characters in reverse order.
The syntax for the REVERSE function in MySQL is:
REVERSE( string )
The source string whose characters are to be reversed.
The REVERSE function can be used in the following versions of MySQL:
Let's look at some MySQL REVERSE function examples and explore how to use the REVERSE function in MySQL.
For example:
mysql> SELECT REVERSE('AODBA.com');
Output: 'moc.tenehtnohcet'
mysql> SELECT REVERSE('abcde');
Output: 'edcba'
mysql> SELECT REVERSE('123');
Output: '321'
mysql> SELECT REVERSE(123);
Output: '321'