• TestingDocs
TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

MySQL

MySQL REVERSE Function

Overview

In this tutorial, we will learn about MySQL REVERSE Function with an example. We can use this function to reverse the string argument.

MySQL REVERSE Function

REVERSE() function reverses the given string to the function. The function returns the string with the characters in the reverse order of the original string.

Syntax

The general syntax of the function is as follows:

REVERSE(<string>)

Examples

Let’s use the function and check the output of the function in this example.

mysql> SELECT REVERSE(‘MySQL Tutorials’);
+—————————-+
| REVERSE(‘MySQL Tutorials’) |
+—————————-+
| slairotuT LQSyM |
+—————————-+

 

MySQL REVERSE Function

 

In this example, we will reverse column values of a database table. Let’s use the Country database table from the world MySQL database. The column is the Name column that contains the country name. Since the table has many rows will filter the output to rows from the ‘South America’ continent.

mysql> SELECT Name, REVERSE(Name)
-> FROM Country
-> WHERE Continent=’South America’;
+——————+——————+
| Name | REVERSE(Name) |
+——————+——————+
| Argentina | anitnegrA |
| Bolivia | aiviloB |
| Brazil | lizarB |
| Chile | elihC |
| Colombia | aibmoloC |
| Ecuador | rodaucE |
| Falkland Islands | sdnalsI dnalklaF |
| French Guiana | anaiuG hcnerF |
| Guyana | anayuG |
| Peru | ureP |
| Paraguay | yaugaraP |
| Suriname | emaniruS |
| Uruguay | yaugurU |
| Venezuela | aleuzeneV |
+——————+——————+

 

MySQL REVERSE Function Example

—

MySQL Tutorials

MySQL Tutorials on this website:

https://www.testingdocs.com/mysql-tutorials-for-beginners/

For more information on MySQL Database:

https://www.mysql.com/

Related Posts

MySQL /

How to secure your SQL Database: Tips and Tricks

DataGrip Desktop Shortcut

MySQL /

Launch DataGrip on Windows

DataGrip Download

MySQL /

Install DataGrip IDE on Windows 11

MySQL Workbench Windows 11

MySQL /

New MySQL Connection in Workbench

MySQL Command-line Client

MySQL /

Command-Line MySQL Client

‹ MySQL CONCAT Function› MySQL String Data Types

Recent Posts

  • How to secure your SQL Database: Tips and Tricks
  • Shaping the Future of Development: Exploring Key Trends in Software Engineering
  • Improving Java Performance with Multithreading
  • Difference between PHP and JavaScript?
  • Bing Conversation Styles
  • ChatGPT Introduction
  • Open Source AI Frameworks
  • Artificial Intelligence Tools
  • Top AI Music Applications
  • Top AI Website Design Tools

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com