How to correct below misspelled data in column market:
market |
---|
SocialMediaAdvertising |
SocialInvesting |
FinancialExchanges |
CloudMagement |
VentureCapital |
I don’t know what syntax to write.
But output should be as below:
market |
---|
Social Media Advertising |
Social Investing |
Financial Exchanges |
Cloud Magement |
Venture Capital |
2
Answers
You can run a series of SQL updates since there aren’t many changes. For example
Cautions:
Be sure to replace
your_table
with the actual name of the table you want to update, for each SQL statement.You might have a typo with "Magement", but I’m not sure
Use can use the regexp_replace() function to insert each a space before each upper case letter. (See demo)
Caution: As presented this Updates every occurrence of an upper case letter inserting a space before it. The
ltrim
removes the space inserted at the beginning of the column. Any uppercase letter preceded by a space creates a double space. Make sure you validate result.