简体   繁体   English

将Oracle SQL转换为HANA SQL

[英]Convert oracle sql to hana sql

I have a where condition in oracle SQL 11g which I want to use in SAP HANA SQL : Oracle SQL query : 我想在SAP HANA SQL中使用的Oracle SQL 11g中有一个where条件:Oracle SQL查询:

NOT  REGEXP_LIKE (UPPER(substr(GEN_ID,4,5)), '[A-Z]')

I have tried using like_regexp but unable to fetch records. 我尝试使用like_regexp,但无法获取记录。

NOT  REGEXP_LIKE (UPPER(substr(GEN_ID,4,5)), '[A-Z]')

I am expecting the regexp_like to work same in HANA 我期望regexp_like在HANA中也能正常工作

试试LIKE_REGEXPR

UPPER(substring(GEN_ID,4,5)) LIKE_REGEXPR  '[A-Z]'

In either database, I think I would phrase this as: 在任何一个数据库中,我想我都将其表述为:

GEN_ID LIKE_REGEXP '^.{3}[^A-Za-z]{5}'

I find that doing part of the string matching using substrings and not and part using regular expressions is more complicated than necessary. 我发现使用子字符串而not部分字符串进行匹配,使用正则表达式部分进行字符串匹配比必要的更为复杂。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM