$ create table foo (bar varchar); $ insert into foo(bar) values('quark'); $ select * from foo where 'something about quarks and stuff' like '%'||bar||'%'; bar ------- quark (1 row)