如何在 Presto SQL 中使用 NOT LIKE 和 % 从搜索中排除项目?

How to exclude items from search using NOT LIKE and % in Presto SQL?

我有以下返回错误的查询:输入不匹配'LIKE'。期望:表达式

select * from sales
where item_name NOT LIKE '%Tortoise%' 

下图说明了我想从我的源数据中得到什么。我想要不包含关键字 "Tortoise" 的记录。

感谢任何有关如何更正此语法的建议,谢谢。

这可能会给您带来预期的结果。

select * 
from sales
where item_name NOT IN (
   select * 
   from sales
   where item_name LIKE '%Tortoise%'
)