0

I have one data sets with inconsistent formatting of text data

One format shows data like:

Red Socks (American)
Brewers (American)
etc

The other format shows

Red Socks - American
Brewers - American
etc

I need to clean up one set so that it matches the other set.

I would like to move all the Brewers - American format

I am having trouble writing a query to change " (" to " - " And deleting any occurrence of "("

2 Answers 2

2

You can use replace:

update data set field = replace(replace(field, ' (', ' - '), ')', '')
Sign up to request clarification or add additional context in comments.

Comments

1

UPDATE testing SET name = REPLACE (name, '(', '- '), name = REPLACE (name, ')', '') WHERE name LIKE '%(%'

Hey, I think this should solve your problem, where 'testing' is the name of table and 'name' is the name of the column.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.