ilike comparison involving attributes and wildcards...

From: "Spirit of Amiga" <spirit_of_amiga(at)h-o-t-m-a-i-l(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: ilike comparison involving attributes and wildcards...
Date: 2002-11-17 00:18:54
Message-ID: yfBB9.15265$2x4.1741066@news20.bellglobal.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The query below seems like a lame hack to me:

SELECT some_column
FROM some_table
WHERE '$some_string_var' ILIKE '%' || some_column || '%';

Is there a more elegant way of comparing a value with a wildcarded column?

TIA,

SoA

Browse pgsql-general by date

  From Date Subject
Next Message Frank Miles 2002-11-17 05:46:41 Re: DECLARE CURSOR
Previous Message Luis Fresco Zens 2002-11-17 00:06:20 Inquiry From Form [pgsql]