–like与regexp_like的用法
presto
where (address like ‘%广州%’ OR address like ‘%北京%’ OR address like ‘%上海%’ OR address like ‘%深圳%’)
或者
presto:
case when (regexp_like (industry,‘土石方|挖机|矿业|装修|建筑|采油|钢构|钢材|油田|煤矿’)) then 1 else 0 end as ZX_B5
HIVE LIKE
count(distinct case when (upper(eventtype) like ‘%TRANSACTION%’ or upper(eventtype) like ‘%WXWMXXYF_PAY%’) then customerId end) as TXN_NUM,
count(distinct case when (upper(eventtype) REGEXP ‘TRANSACTION|WXWMXXYF_PAY’) then customerId end) as TXN_NUM2
count(distinct case when risCode = ‘10000’ and lower(eventtype) like ‘%transaction’ then transactionid end) as TXN_PAS_ITM
regexp_like(upper(eventType), ‘TRANSACTION|WXWMXXYF_PAY’)
| 和 or的作用是一致的