In article 
<482e80323a35a54498b8b70ff2b8798003e5ac7...@azsmsx504.amr.corp.intel.com>,
"Gauthier, Dave" <dave.gauth...@intel.com> writes:

> I have a temp table containg wildcarded strings and I want to select values
> froma different table using ?like? against all those wildcarded values.  
> Here?s
> the example...

> create temporary table match_these (val varchar(32));

> insert into match_these (val) values (?jo%?);

> insert into match_these (val) values (?%denn_?);

> insert into match_these (val) values (?alt%?);

> create table footable (name varchar(32));

> (insert a bunch of records)

> Now...

> 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)

Why don't you use a simple join?  Something like

  SELECT f.name
  FROM footable f
  JOIN match_these m ON f.name ~~ m.val


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

Reply via email to