如何替换所有非数字值? [英] How to replace all nonnumeric values?

查看:19
本文介绍了如何替换所有非数字值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是 TERADATA(不是 SQL Server,也不是 Oracle)

This is TERADATA (not SQL Server, not Oracle )

我有一列电话号码:

(312)9879878
(298)989-9878
430-394-2934
394s9048ds987
..........

我需要将此列清理成

3129879878
2989899878
4303942934
3949048987
..........

所以只有数字应该保留.所有其他字母、特殊字符、连字符...都应该删除.我该怎么做?

So that only numbers should stay. All other letters, special characters, hyphens ... should be removed. How can I do this?

推荐答案

您的站点正在运行 TD 的哪个版本?如果它是 14 或者你安装了 oTranslate UDF,你可以简单地做一个嵌套翻译的老技巧:

Which release of TD is running at your site? If it's 14 or you got the oTranslate UDF installed you can simply do an old trick nesting Translate:

oTranslate(phonenum, oTranslate(phonenum, '0123456789', ''), '')

这篇关于如何替换所有非数字值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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