GeekInterview.com
Series: Subject: Topic:
Question: 2 of 190

Reversing String in Oracle without using reverse function

How do I reverse a string using only Oracle SQL without using the reverse function??
Asked by: amit88 | Member Since Apr-2012 | Asked on: Apr 5th, 2012

View all questions by amit88

Showing Answers 1 - 1 of 1 Answers
Siva Kumar S

Answered On : Apr 7th, 2012

I just took employees tables last_name. See the code.

Code
  1. SELECT substr(last_name,4,1)||substr(last_name,4,2)||substr(last_name,2,1)||substr(last_name,1,1)
  2. "Reversing Name" FROM employees
  3. WHERE employee_id=100

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.