What is REVERSE() in SQL?
The REVERSE() function reverses the order of a string.
Figure 1 shows a visual representation of the REVERSE() function.
Syntax
REVERSE(string)
Parameters
The REVERSE() function takes a string as a parameter.
Return value
REVERSE() returns the string sent as a parameter in the reverse order.
This function returns
NULLifNULLis sent as a parameter.
Example
-- simple stringSELECT REVERSE('HELLO');-- palindrome stringSELECT REVERSE('LEVEL');-- NULLSELECT REVERSE(NULL);