REVERSE String Function in MSSQL and MySQL


The REVERSE string function returns a string in reverse order. It does the same job in both MS SQL Server and MySQL, with the same name and syntax in both databases.

MSSQL

Syntax:

REVERSE ( string_expression )

Example:

select REVERSE('ABCDEF');
-----------------
FEDCBA

REVERSE function in MS SQL Server

MySQL

In MySQL, the same function is available with the same name.

Syntax:

REVERSE( str_to_reverse )

Example:

mysql> select REVERSE('ABCDEF');
+--------------------+
| REVERSE('ABCDEF')  |
+--------------------+
| FEDCBA             |
+--------------------+

REVERSE function in MySQL

Back to Converting Functions from MSSQL to MySQL