informix DB中是否定义了任何alpha逻辑

informix DB中是否定义了任何alpha逻辑,informix,alpha,Informix,Alpha,我正在使用informix DB,我需要获取最后一个字符上包含alpha[A-Za-z]字符的记录 我尝试的是: select * from table_name where (SUBSTR(trim(customer),-1,1)!='0' and SUBSTR(trim(customer),-1,1)!='1' and SUBSTR(trim(customer),-1,1)!='2' and SUBSTR(trim(customer),-1,1)!='3' and SUBSTR(trim(

我正在使用informix DB,我需要获取最后一个字符上包含alpha[A-Za-z]字符的记录 我尝试的是:

select * from table_name 
where (SUBSTR(trim(customer),-1,1)!='0' and SUBSTR(trim(customer),-1,1)!='1' and SUBSTR(trim(customer),-1,1)!='2' and SUBSTR(trim(customer),-1,1)!='3' and SUBSTR(trim(customer),-1,1)!='4' and SUBSTR(trim(customer),-1,1)!='5' and SUBSTR(trim(customer),-1,1)!='6' and SUBSTR(trim(customer),-1,1)!='7' and SUBSTR(trim(customer),-1,1)!='8' and SUBSTR(trim(customer),-1,1)!='9') or (SUBSTR(trim(customer),-1,1)=' ') or (SUBSTR(trim(customer),-1,1)='') or (customer IS NULL)
是否有任何方法可以写入,其中SUBSTR(trim(customer),-1,1)=alpha而不是写入
SUBSTR(修剪(客户),-1,1)!='0'和SUBSTR(修剪(客户),-1,1)!='1'和子项(装饰件(客户),-1,1)!='2'和SUBSTR(饰件(客户),-1,1)!='3'和SUBSTR(饰件(客户),-1,1)!='4'和SUBSTR(饰件(客户),-1,1)!='5'和SUBSTR(饰件(客户),-1,1)!='6'和SUBSTR(饰件(客户),-1,1)!='7'和SUBSTR(饰件(客户),-1,1)!='8'和SUBSTR(饰件(客户),-1,1)!='9'

如果您有“最新”版本的Informix(任何超过12.10的版本都可以),您可以使用regex_match():

比如:

> select * from table(set{'test','test1','tesT'})
  where regex_match(unnamed_col_1, '[a-zA-Z]$');

unnamed_col_1

test
tesT

2 row(s) retrieved.

>

您可以使用任何版本都支持的Informix MATCHES操作符。 查询如下所示:

select * from table_name 
 where customer matches "*[A-Za-z]"