Re: using output of a subselect in LIKE/ILIKE

From: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
To: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
Cc: PostgResql SQL Mailing List <pgsql-sql(at)postgresql(dot)org>
Subject: Re: using output of a subselect in LIKE/ILIKE
Date: 2002-04-11 15:17:52
Message-ID: 3CB5A920.9E5B95D7@trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


thanks Jeff it worked !

after adding a '%' || after LIKE though :-)

WORKING SQL:

SELECT branch from branches where outstation ilike '%' || (SELECT city
from users join personal_account_details using(userid) where
email='ratans(at)cal(dot)vsnl(dot)com') || '%';

Jeff Eckermann wrote:

> SELECT branch from branches
> where outstation like
> (SELECT city from users join
> personal_account_details
> using(userid) where email='ratans(at)cal(dot)vsnl(dot)com') ||
> '%'
>
> --- Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
> wrote:
> > Hi folks,
> >
> > I need to do something like :
> >
> > SELECT branch from branches
> > where outstation like
> > SELECT city from users join
> > personal_account_details
> > using(userid) where email='ratans(at)cal(dot)vsnl(dot)com'
> >
> > The above does not work for obvious reasons , but
> > can anyone help me
> > with the right SQL?
> >
> >
> > regds
> > Rajesh Kumar Mallah.
> >
> >
> >
> >
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-04-11 15:36:12 Re: REPOST: Trouble with SQL conversion
Previous Message Richard Ellerbrock 2002-04-11 15:16:50 Re: REPOST: Trouble with SQL conversion