使用 like 运算符检查配置单元中的模式
Using like operator to check for pattern in hive
我需要从必须以大写字母开头并以数字结尾的配置单元 table 中检索列。
我使用了这个查询
select * from tab1 where col1 like '[A-Z]%[0-9]';
但无法检索记录,只得到空结果。
rlike / regexp
select * from tab1 where col1 rlike '^[A-Z].*[0-9]$';
我需要从必须以大写字母开头并以数字结尾的配置单元 table 中检索列。 我使用了这个查询
select * from tab1 where col1 like '[A-Z]%[0-9]';
但无法检索记录,只得到空结果。
rlike / regexp
select * from tab1 where col1 rlike '^[A-Z].*[0-9]$';