MySQL REVERSE() Function
THE WORLD'S LARGEST WEB DEVELOPER SITE

MySQL REVERSE() Function

❮ MySQL Functions

Example

Reverse a string:

SELECT REVERSE("SQL Tutorial");
Try it Yourself »

Definition and Usage

The REVERSE() function reverses a string and returns the result.

Note: The REVERSE() function is safe to use with multi-bytes.

Syntax

REVERSE(string)

Parameter Values

Parameter Description
string Required. The string to reverse

Technical Details

Works in: MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23

More Examples

Example

Reverse the text in CustomerName:

SELECT REVERSE(CustomerName)
FROM Customers;
Try it Yourself »

❮ MySQL Functions