Search Postgresql Archives

Re: selecting recs based on a tmp tbl vals that are wildcarded ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Gauthier, Dave" <dave.gauthier@xxxxxxxxx> writes:
> select * from footable where name in (select val from match_these)

> ... won't work because "in" implies equality.  I want something like...

> select * from footable where name like (select val from match_these)

What you need is

 select * from footable where name ~~ any (select val from match_these)

It would probably be clearer to write

 select * from footable where name like any (select val from match_these)

but the ANY syntax requires an operator name, so you have to write the
operator equivalent for LIKE.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux