Database: Oracle 11.2.0.1.0
In the database, we have values in columns that contain "white spaces" some times before and/or after the value. What is the best procedure to remove these extra white spaces? I have provided examples below.
AccountNumber | InvoiceNumber |
---|
123 | INV-123 |
456 | INV-456 |
789 | INV-456 |
123 456 | INV 123456 |
Row 1, has 5 white spaces before the value.
Row 2, has 5 white spaces after the value
Row 3, has 5 white spaces before and after the value
Row 4, has 5 white spaces between the value <==== this one is okay
Essentially, I would want to trim the LEFT and RIGHT side only. Every thing in between does not seem to be an issue at this moment. Is the below query the best procedure to handle the removal?
update table1
set AccountNumber = trim(AccountNumber);