Reputation: 1677
I have a column in a table that has values encapsulated in quotation marks (i.e. "USA", "Mexico", "Russia", "China", etc.) I would like to remove the quotation marks and leave the rest of the string intact (USA, Mexico, etc.). Is there a simple statement for this? Or do I need to use a combination of LEFT, RIGHT, and SUBSTRING functions? Thanks in advance
Upvotes: 0
Views: 6277
Reputation: 311
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 actually want to modify the data.
Upvotes: 0
Reputation: 17540
This will remove all the "
marks, even those in the middle of the value.
UPDATE YourTable
SET CountryName = REPLACE(CountryName, '"', '');
Upvotes: 5