Skip site navigation (1) Skip section navigation (2)


From: David Wheeler <david(at)kineticode(dot)com>
To: josh(at)agliodbs(dot)com
Cc: sfpug(at)postgresql(dot)org
Subject: Re: LIKE IN
Date: 2004-03-02 05:53:39
Message-ID: (view raw, whole thread or download thread mbox)
Lists: sfpug
On Mar 1, 2004, at 9:41 PM, Josh Berkus wrote:

> I think it would be possible to implement a "value LIKE ( 
> 'x%','y%','z%')" in
> postgreSQL but you'd have to get someone interested in hacking it.

Actually, this works:

   select 'a' ~~ ANY (SELECT 'a' UNION SELECT 'b');

It's a little ugly, though. In 7.4, you can use this:

   SELECT 'a' ~~ ANY(array['a%','b%']);

Which is slightly better. But I think I'll stick to this for now:

   SELECT * from element where name LIKE 'a%' OR name LIKE 'b%';



In response to

sfpug by date

Next:From: Fred MoyerDate: 2004-03-12 11:30:20
Subject: Re: Reminder: Meeting Next Week -- RSVP Please
Previous:From: Josh BerkusDate: 2004-03-02 05:41:30
Subject: Re: LIKE IN

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group