Tutorial Gateway

  • C
  • C#
  • Python
  • SQL
  • Java
  • JS
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs
  • MySQL

MySQL REVERSE Function

MySQL Reverse is one of the String Function, which is useful to reverse the user-specified expression (or column value). In this article, we reveal to you, How to write MySQL String reverse using Command Prompt and Workbench with example.

MySQL Reverse Syntax

The basic syntax of Reverse in MySQL is as shown below:

SELECT REVERSE (String_Expression)
FROM Source

For this string reverse function demonstration, we are going to use the below shown data

MySQL Reverse Function Example 1

MySQL Reverse Example 1

The MySQL string Reverse function reverses the given string and returns the output. The following query shows multiple ways to use this Reverse function.

-- MySQL String Reverse Example
SELECT REVERSE('Learn MySQL Server') AS `Reversed String`;

SELECT REVERSE('Tutorial Gateway') AS `Reversed String`;
SQL REVERSE Example 1

MySQL Reverse Example 2

The reverse string in MySQL also allows you to reverse the data inside the table columns. In this string function example, we are going to reverse the length string data present in the Department Name and Email column.

-- MySQL String Reverse Example
USE mysqltutorial;
SELECT  FirstName, LastName, 
		DepartmentName, 
        REVERSE(DepartmentName) AS `Department in Reverse`,
        Email,
        REVERSE(Email) AS `Email in Reverse`
FROM employe
ORDER BY FirstName, LastName;

SQL REVERSE Example 2

Filed Under: MySQL

  • How to Download MySQL
  • Install MySQL on Windows
  • MySQL Create Database
  • MySQL Delete Database
  • MySQL Create Table
  • MySQL Drop Table
  • MySQL SELECT Statement
  • MySQL ALIAS Column
  • MySQL Distinct
  • MySQL Insert Statement
  • MySQL Delete
  • MySQL Truncate Table
  • MySQL WHERE Clause
  • MySQL Order By
  • MySQL Group By
  • MySQL Having Clause
  • MySQL LIMIT
  • MySQL Arithmetic Operators
  • MySQL COALESCE Function
  • MySQL AND Operator
  • MySQL NOT Operator
  • MySQL OR Operator
  • MySQL XOR Operator
  • MySQL BETWEEN Operator
  • MySQL Not Between Operator
  • MySQL GREATEST Function
  • MYSQL LEAST Function
  • MySQL LIKE Operator
  • MySQL NOT LIKE Operator
  • MySQL IFNULL Operator
  • MySQL NULLIF Operator
  • MySQL INTERVAL Operator
  • MySQL IS Operator
  • MySQL IN Operator
  • MySQL NOT IN Operator
  • MySQL IS NOT NULL
  • MySQL IS NULL
  • MySQL Inner Join
  • MySQL Cross Join
  • MySQL Right Join
  • MySQL Left Join
  • MySQL Aggregate Functions
  • MySQL Date Functions
  • MySQL Date Function
  • MySQL String Functions
  • MySQL Numeric Functions

Copyright © 2021ยท All Rights Reserved by Suresh.
About | Contact | Privacy Policy