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
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
This will remove all the "
marks, even those in the middle of the value.
UPDATE YourTable
SET CountryName = REPLACE(CountryName, '"', '');
回答2:
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.