pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rajesh Kumar Mallah <mallah@trade-india.com>
To: Jeff Eckermann <jeff_eckermann@yahoo.com>
Cc: PostgResql SQL Mailing List <pgsql-sql@postgresql.org>
Subject: Re: using output of a subselect in LIKE/ILIKE
Date: Thu, 11 Apr 2002 20:47:52 +0530
Message-ID: <3CB5A920.9E5B95D7@trade-india.com> (raw)
References: <20020411144818.39555.qmail@web20804.mail.yahoo.com>


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@cal.vsnl.com') || '%';



Jeff Eckermann wrote:

> SELECT  branch from  branches
> where outstation like
> (SELECT  city from users  join
> personal_account_details
> using(userid)  where email='ratans@cal.vsnl.com') ||
> '%'
>
> --- Rajesh Kumar Mallah <mallah@trade-india.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@cal.vsnl.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




view thread (3+ messages)

Message-ID: <3CB5A920.9E5B95D7@trade-india.com>
Permalink:  ../3CB5A920.9E5B95D7@trade-india.com/
Also on:    postgresql.org/message-id/3CB5A920.9E5B95D7@trade-india.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mallah@trade-india.com, jeff_eckermann@yahoo.com
  Subject: Re: using output of a subselect in LIKE/ILIKE
  In-Reply-To: <3CB5A920.9E5B95D7@trade-india.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox