- Overview
- Data types
- Commands
- Functions
- Overview
- Aggregate
- Conditional expression
- Conversion
- Date and time
- Numeric
- String
- Semi-structured data
On this page
reverse
Reverses the order of characters in a string.
The returned value is the same length as the input, but with the characters in reverse order. If subject is NULL, the result is also NULL.
Syntax
reverse(<subject>)
Examples
This example reverses a string:
SELECT reverse('Hello, world!');
+--------------------------+
| reverse('Hello, world!') |
+--------------------------+
| !dlrow ,olleH |
+--------------------------+