如何使用SQL获取字符串中的奇数字符 [英] How can I get odd numbered characters in a string using SQL

查看:232
本文介绍了如何使用SQL获取字符串中的奇数字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一些加密数据,我需要从字符串中获取奇数字符并填充到列中:

I am playing with some encrypted data and I need to get the odd numbered characters from a string and populate into a column:

abcedfgh

acdg

真的可以用SQL做到吗?我尝试使用Google搜索,但是找不到任何搜索结果.

Is it really possible to do it in SQL? I tried googling on this but couldn't find any search results.

推荐答案

SELECT REGEXP_REPLACE(mycolumn, '(.).', '\1')
FROM   mytable

这篇关于如何使用SQL获取字符串中的奇数字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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