Friday, May 18, 2018

How do you reverse the order of letter in string using SQL?

Problem statement: How do you use reverse function in sql?
Syntax:
SELECT reverse(column_name) FROM Table;

e.g.
id | name | salary
01  ram      2000
02  rani      3000             ==> old_emp
03  lata       1500
04  mary    1700


mysql>SELECT reverse(name) FROM old_emp;
output:
reverse(name)
----------------
mar
inar
atal
yram

No comments:

Post a Comment

How to run standalone mock server on local laptop

 Please download the standalone wiremock server from Direct download section at the bottom of the page.  Download and installation Feel fre...