我需要帮助查找不以特定字符串开头的字符串,并且第二部分应在任何位置包含特定字符串并且应包含 4 个点
目前我正在这样做。需要更好的方法来做到这一点
table_name like '%.%.%.%' AND table_name not like 'click%' AND split(table_name,'\\\\.')[1] rlike 'click'
样本数据
catalog.aw_click_567.fact.empl -- This should come in output
sales.click.fact.profit -- This should come in output
click_ext.aw_click_567.fact.empl -- This shouldn't
我在上面尝试了 3 个 And 条件,但应该有一种更好的方法来使用一个正则表达式条件
试试这个
(table_name LIKE '%.%.%.%' OR table_name LIKE '%.click.%')
AND table_name NOT LIKE 'click%'