Use of REVERSE Function in SQL

Use of REVERSE Function in SQL:

(1) “REVERSE” function is used for reversing the string.

(2) Let’s take an example of reversing the Vendor Name as shown.

(3) Select the database in the SQL server and click on the “New Query” button as shown.

Select the database in the SQL server and click on the new query button

(4) After that new query editor opens as shown.

new query editor open in sql

(5) After doing the above steps, write a query in the editor, as shown.

reverse function query in sql

Source Code:

–//Use Of REVERSE Function
Select [No_] AS [Vendor No.],[Name] AS [Vendor Name],
REVERSE([Name])AS [REVERSE(the String)]
Fromdbo.[CRONUS India Ltd_$Vendor$437dbf0e-84ff-417a-965d-ed2bb9650972]
Where [No_] IN(‘V00040′,’45858585′,’IC1020’)
–//Use Of REVERSE Function

(6) Then Execute or Press F5 to run the query and see the result as shown.

execute reverse function query in sql by f5

Use of GROUP BY Statement in SQL
Use of UNION and UNION ALL Operator in SQL
Use of ALIASES operator in SQL
Use of BETWEEN Operator in SQL
REVERSE (Transact-SQL)– Microsoft Docs

Leave a Reply