问题
I need to retrieve the columns from a hive table that must begin with uppercase letter and end with digit. I used this query
select * from tab1 where col1 like '[A-Z]%[0-9]';
But not able to retrieve the records ,getting only empty result.
回答1:
rlike / regexp
select * from tab1 where col1 rlike '^[A-Z].*[0-9]$';
来源:https://stackoverflow.com/questions/42809183/using-like-operator-to-check-for-pattern-in-hive