Re: trying to pattern match to a value contained in a column

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Beth Gatewood <bethg(at)mbt(dot)washington(dot)edu>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: trying to pattern match to a value contained in a column
Date: 2000-12-07 21:39:07
Message-ID: Pine.LNX.4.30.0012072238000.780-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Beth Gatewood writes:

> So-If I had a table where I had LONG_NAME and ABBR as attributes.
>
> I want something like
>
> SELECT whatever FROM my_table WHERE long_name LIKE '%[the value of ABBR
> in that row]%';

SELECT whatever FROM my_table a, my_table b WHERE a.long_name like (b.abbr || '%');

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Beth Gatewood 2000-12-07 21:45:00 Re: trying to pattern match to a value contained in a column
Previous Message Francis Solomon 2000-12-07 21:28:55 RE: trying to pattern match to a value contained in a column