从数据库字段中删除特殊字符 [英] Remove special characters from a database field

查看:130
本文介绍了从数据库字段中删除特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有几千个记录的数据库,我需要删除其中一个字段,以确保它只包含某些字符(字母数字,空格和单引号)。我可以使用什么SQL从整个数据库的该字段中剥离任何其他字符(如斜杠等)?

I have a database with several thousand records, and I need to strip down one of the fields to ensure that it only contains certain characters (Alphanumeric, spaces, and single quotes). What SQL can I use to strip any other characters (such as slashes, etc) from that field in the whole database?

推荐答案

update mytable
set FieldName = REPLACE(FieldName,'/','')

这是一个很好的开始。

这篇关于从数据库字段中删除特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆