REVERSE
All functions > STRING > REVERSE
Returns the string with all characters in reverse order.
Signatures
Returns: String with characters in reverse order
REVERSE(string: VARCHAR) → VARCHAR sql
| Parameter | Type | Required | Description |
|---|---|---|---|
string | VARCHAR | Yes | String to reverse |
Notes
- Reverses character order, not byte order
- Handles Unicode characters correctly
- Palindromes remain unchanged
Examples
FeatureQL
SELECT
f1 := REVERSE('Hello World'), -- Reverse entire string
f2 := REVERSE('ABCDEF'), -- Alphabetic reversal
f3 := REVERSE('12345'), -- Numeric string reversal
f4 := REVERSE('racecar'), -- Palindrome stays same
f5 := REVERSE('A') -- Single character
;Result
| f1 VARCHAR | f2 VARCHAR | f3 VARCHAR | f4 VARCHAR | f5 VARCHAR |
|---|---|---|---|---|
| dlroW olleH | FEDCBA | 54321 | racecar | A |
On this page