Delete quotes on all rows in a column

I have a column in a table that has values โ€‹โ€‹enclosed in quotation marks (for example, "USA", "Mexico", "Russia", "China", etc.). I would like to remove the quotes and leave the rest (USA, Mexico, etc.). Is there a simple statement for this? Or do I need to use a combination of the LEFT, RIGHT, and SUBSTRING functions? thanks in advance

0
source share
2 answers

This will delete all marks, even those that are in the middle of the value.

 UPDATE YourTable SET CountryName = REPLACE(CountryName, '"', ''); 
+4
source

Well, if you want to get rid of all double quotes, how about:

 SELECT REPLACE(countryColumn, '"', '') AS countryColumn FROM theTable 

Or a similar update if you really want to change the data.

0
source

All Articles