REVERSE() - Reversing String

Q

How to reverse a given string using the REVERSE() function?

✍: FYIcenter.com

A

REVERSE(str) is a MySQL built-in function that repeats a substring in a given string. For example:

SELECT REVERSE('oprah');
  -- +------------------+
  -- | REVERSE('oprah') |
  -- +------------------+
  -- | harpo            |
  -- +------------------+

Reference information of the REVERSE() function:

REVERSE(str): modstr
  Returns the string str with the order of the characters reversed, or
  NULL if str is NULL.

Arguments, return value and availability:
  str: Required. The given string to be reversed.
  modstr: Return value. The reversed string.
  Available since MySQL 4.0.

 

RIGHT() - Last N Characters

REPLACE() - Replacing Substring

MySQL Functions on Character String Values

⇑⇑ MySQL Function References

2023-11-13, 232🔥, 0💬