Presto/MySQL-用于检查列值是否为字母数字的正则表达式
我希望在列中只获取字母数字值。我已经尝试了以下Presto查询,但我仍然得到数字和字母数字值 查询: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
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中工作。此外,请阅读以下内容: