如何仅获取分配给“usa\u rbb\u wa\u bu”的“\u wa”数据?但是,我看到的列中有行包含∗wa和∗sa(usa\u ca\u sawant)
我用过,
select....
'USA_RBB_WA_BU' AS State ,
District
from TABLE where district like '%_WA%'
select ...
'USA_RBB_NSW_BU' AS State ,
District
from TABLE where district like '%_SA%'
然而,我最终得到了下面的数据输出表
**state district**
USA_RBB_NSW_BU USA_CA_SAWANT
USA_RBB_WA_BU USA_CA_SAWANT
USA_RBB_NSW_BU USA_CA_SAWANT
USA_RBB_WA_BU USA_CA_SAWANT
我试过了
select....
'USA_RBB_WA_BU' AS State ,
District
from TABLE where district like '_WA%'
output was was 0 results in hive
2条答案
按热度按时间wxclj1h51#
我猜你是想逃跑
_
在这里。试试下面-hrirmatl2#
where district rlike '_WA'
将正常工作(如果字符串包含\u wa,则返回true)如果您希望字符串包含前后的内容
_WA
,添加.+
(任意字符一次或多次):