How to remove spaces in the middle of a string using Oracle?

To remove spaces from a string in Oracle, you can use the REPLACE function. Here is an example:

To remove the spaces in the middle of the string ‘A B C’ while keeping the spaces at the beginning and end, you can use the following SQL statement:

SELECT REPLACE('A B C', ' ', '') FROM dual;

This will return the result as ‘ABC’, which means removing the middle space.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds