REVERSE
functionsupportedCore SQL functionsReverses the order of characters in a string, or of bytes in a binary value. The returned value is the same length as the input, but with the characters/bytes in reverse order. If subject is NULL, the result is also NULL.
Syntax
REVERSE(<subject>)
Collation details
- No impact. - The collation of the result is the same as the collation of the input. - In languages where the alphabet contains digraphs or trigraphs (such as “Dz” and “Dzs” in Hungarian), each character in each digraph and trigraph is treated as an independent character, not as part of a single multi-character letter. For example, languages with 2-character and 3-character letters (e.g. “dzs” in Hungarian, “ch” in Czech) are reversed based on the individual characters, not the letters. See the Examples section below for an example.