Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Presto/MySQL-用于检查列值是否为字母数字的正则表达式_Mysql_Presto - Fatal编程技术网

Presto/MySQL-用于检查列值是否为字母数字的正则表达式

Presto/MySQL-用于检查列值是否为字母数字的正则表达式,mysql,presto,Mysql,Presto,我希望在列中只获取字母数字值。我已经尝试了以下Presto查询,但我仍然得到数字和字母数字值 查询: select seller_id from myTable where logdate = '2019-10-07' and regexp_like(seller_id,'^[a-z0-9A-Z]+$') 实际结果: 12345 f7c865ff 1003147 c743a319 z87wm google 预期结果: f7c865ff c743a319 z87wm

我希望在列中只获取字母数字值。我已经尝试了以下Presto查询,但我仍然得到数字和字母数字值

查询:

select 
   seller_id
from 
   myTable 
where 
  logdate = '2019-10-07'
  and regexp_like(seller_id,'^[a-z0-9A-Z]+$')
实际结果:

12345
f7c865ff
1003147
c743a319
z87wm
google
预期结果:

f7c865ff
c743a319
z87wm
google
谁能帮我改进一下,这样我就只能得到字母数字值吗?

请试试这个

select 
   seller_id
from 
   myTable 
where 
  logdate = '2019-10-07'
  and 
  regexp_like(seller_id,'^[a-zA-Z]+[a-z0-9A-Z]+$')

这不包括开头没有字母(大写或小写)的所有内容。

CAST应在presto中工作。此外,请阅读以下内容: