Re: where col1 not ilike ('str1%', 'str2%'... 'strN%') support?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: emilu(at)encs(dot)concordia(dot)ca
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: where col1 not ilike ('str1%', 'str2%'... 'strN%') support?
Date: 2011-08-30 15:24:36
Message-ID: 16967.1314717876@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Emi Lu <emilu(at)encs(dot)concordia(dot)ca> writes:
> Does psql provide something like the following query command?

> select * from tablename
> where col1 not ilike ('str1%', 'str2%'... 'strN%')

If you remember the operator name equivalent to ILIKE (~~*)
you can do

select * from tablename
where not (col1 ~~* any(array['str1%', 'str2%'... 'strN%']));

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Emi Lu 2011-08-30 15:48:38 Re: where col1 not ilike ('str1%', 'str2%'... 'strN%') support?
Previous Message Julien Cigar 2011-08-30 15:01:56 Re: where col1 not ilike ('str1%', 'str2%'... 'strN%') support?