Received: from mail-relay.trade-india.com (unknown [203.196.129.235]) by postgresql.org (Postfix) with SMTP id 94F6C477230 for ; Thu, 11 Apr 2002 11:14:17 -0400 (EDT) Received: (qmail 13780 invoked from network); 11 Apr 2002 15:20:59 -0000 Received: from system11.trade-india-local.com (HELO trade-india.com) (192.168.0.11) by ptil-236-129-del.primus-india.net with SMTP; 11 Apr 2002 15:20:59 -0000 Message-ID: <3CB5A920.9E5B95D7@trade-india.com> Date: Thu, 11 Apr 2002 20:47:52 +0530 From: Rajesh Kumar Mallah X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en MIME-Version: 1.0 To: Jeff Eckermann Cc: PostgResql SQL Mailing List Subject: Re: using output of a subselect in LIKE/ILIKE References: <20020411144818.39555.qmail@web20804.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200204/139 X-Sequence-Number: 7404 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 > 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