REVERSE()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns a string with all the characters reversed.
USAGE
REVERSE(string)
Argument Name | Description |
---|---|
| The string to reverse |
DETAILS
REVERSE()
is a string function that returns the supplied string with all its characters reversed.
The reversal affects characters, not bytes, which keeps multi-byte characters valid.
A NULL
is returned if the argument is NULL
.
EXAMPLES
SELECT REVERSE('GoH angASal a mi ImALas a gnaH og');
+----------------------------------------------+
| REVERSE('GoH angASal a mi ImALas a gnaH og') |
+----------------------------------------------+
| go Hang a saLAmI im a laSAgna HoG |
+----------------------------------------------+
SET NAMES utf8;
SELECT REVERSE(CONCAT(
'racecar ',
_utf8 x'C2A9',
' mom dad')) AS result;
+--------------------+
| result |
+--------------------+
| dad mom © racecar |
+--------------------+