删除在字符串列中找到的数字 [英] Remove numbers found in string column

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

问题描述

使用Sqlite删除在其他字符串列中找到的所有数字的SQL是什么(也将使用Oracle示例)?

What would be the SQL to remove all numbers found in an otherwise string column using Sqlite (an Oracle example would be appreciated too)?

示例:我想从这样的条目中删除所有数字:

Example : I would like to remove all numbers from entries like this :

291 HELP,1456 CALL

预期输出:

HELP,CALL

我已经编辑了该问题,因为不仅要删除一个条目,而且要删除其中的许多号码.

edit: I have edited the question because it is not only from one entry that I want to remove numbers but many of them.

推荐答案

您可以使用该语言执行此操作,嵌入sqlite或使用此SQLite代码删除所有数字:

Either you do it in the language, you embedded sqlite, or you use this SQLite code, that removes all numbers:

UPDATE table SET column = replace(column, '0', '' );
UPDATE table SET column = replace(column, '1', '' );
UPDATE table SET column = replace(column, '2', '' );
UPDATE table SET column = replace(column, '3', '' );
UPDATE table SET column = replace(column, '4', '' );
UPDATE table SET column = replace(column, '5', '' );
UPDATE table SET column = replace(column, '6', '' );
UPDATE table SET column = replace(column, '7', '' );
UPDATE table SET column = replace(column, '8', '' );
UPDATE table SET column = replace(column, '9', '' );

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

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