select * from gy_jbbm where regexp_substr(jbmc,'[0-9]+') is not null

 

背景:
表中某一字段中应该为纯数字,偶然发现该字段包含其他值,故,需要对不是纯数字的数据项进行过滤

脚本:
select distinct sub_account_item
from pay_transaction_detail
where trim(translate(sub_account_item, '0123456789', ' ')) is not null
解释:
translate函数将数据列sub_account_item中的数据替换为‘ ’,注意此处必须有空格,否则过滤不生效。

如果要过滤纯数字项,则将is not null改为is null
————————————————
版权声明:本文为CSDN博主「pengShuai007」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/pengShuai007/article/details/83031973

相关文章:

  • 2021-08-04
  • 2021-10-24
  • 2021-12-06
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-10-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2021-10-08
  • 2021-10-11
相关资源
相似解决方案