在Postgres中返回否定匹配

时间:2017-02-10 08:31:29

标签: postgresql

让我们说我想找到包含匹配项的行。例如:

select * from tableName where tableName.colName like '%abc%' limit 5;

这将为我提供包含表abc中列colName内的子字符串tableName的行。现在,如何获取列colName 列包含字符串abc的行。 Postgres中是否有某种否定运算符?

1 个答案:

答案 0 :(得分:2)

使用not like

select * from tableName where tableName.colName not like '%abc%' limit 5;
相关问题