我的问题:
case
when upper(a.camp_name) like "%Event%" and (upper(a.camp_name) not like "%Event-WBR%" or upper(a.camp_name) not like "%Event-Webinar%") THEN "Field"
else "Demand"
end as Tactic
期望输出:
Event-WBR = Demand
Event = Field
实际输出:
Event-WBR = Field
Event = Field
2条答案
按热度按时间fjaof16o1#
你可以用两个
when
学生:v1uwarro2#
实际上你应该用and替换or
但这里还有另外两个选择:
如果你只想做“事件”这个词,你可以这样做
如果你只想排除这两个词,你可以这样做。