"like any" in reverse?

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: "like any" in reverse?
Date: 2010-02-12 03:03:53
Message-ID: 482E80323A35A54498B8B70FF2B87980044450D424@azsmsx504.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi:

create table foo (lst text[]);
insert into foo (lst) values (array['jack','fred','jen','sue']);

I want to find all records where any element of lst like 'j%'.

This does not work...

select * from foo where 'j%' like any(lst);

Intuitively, you'd think....

select * from foo where any(lst) like 'j%';

... but that's a syntax error.

Can this be done?

Thanks in Advance !

Responses

Browse pgsql-general by date

  From Date Subject
Next Message u235sentinel 2010-02-12 04:23:08 Re: Postgres Triggers issue
Previous Message Robert James 2010-02-12 01:20:59 Postgres standard versus Postgres Plus Advanced Server