The REVERSE function returns a string with its characters arranged in reverse order.
Reversing strings can be useful for text analysis, pattern processing, and extracting information from the end of values.
Reverse an employee code for a text-processing operation.
SELECT
EmployeeCode,
REVERSE(EmployeeCode) AS ReversedCode
FROM Employees;
REVERSE can support text analysis, suffix processing, data transformation, and string manipulation.
- REVERSE changes the character order.
- The first character becomes the last.
- It is useful for string manipulation.
- It can support suffix analysis.
- The original value is not changed.
What does REVERSE do?
REVERSE returns the characters of a string in reverse order.
Does REVERSE permanently change the stored value?
No. Unless the result is explicitly stored through an update operation, REVERSE only returns a transformed value.