Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: RE : IN MISTERY

Re: RE : IN MISTERY

From: sergio <smoriano_at_sicon.net>
Date: Tue, 16 May 2000 09:03:11 +0200
Message-Id: <10498.105714@fatcity.com>


Thanks a lot. With this query it works perfectly.

Stephane Faroult wrote:

> Sergio,
>
> IN checks either a hard-coded list or EACH ROW of a subquery - It
> cannot work with a subquery returning something which looks like a
> hard-coded list.
> I have an awful feeling of not being very clear but, assuming that
> none of your 'lista_tipo_publi' is a substring of another one, this
> should work :
>
> select ltp.lista_tipo_publi from lista_tipo_publi ltp
> where exists (select null
> from lista_pautas lp
> where instr(lp.tipos, ltp.lista_tipo_publi) != 0
> and lp.id_pauta = '6')
> --
> HTH,
>
> Stephane Faroult
> email: sfaroult_at_oriolecorp.com
> Oriole Corporation
> Voice: +44 (0) 7050-696-269
> Fax: +44 (0) 7050-696-449
> Performance Tools & Free Scripts
> ------------------------------------------------------------------
> http://www.oriolecorp.com, designed by Oracle DBAs for Oracle DBAs
> ------------------------------------------------------------------
>
> >
> > Hi all
> >
> > I have the next query with the in clause, and it doesn´t works, any
> > idea?.
> >
> > I f i execute the query,
> > select'''||replace(tipos, ', ' , ''', ''')||'''' from lista_pautas
> > where id_pauta='6'
> > i get the result:
> >
> > 'palabras', 'negritas', 'sin cargo breves'
> >
> > With the query,
> > select lista_tipo_publi from lista_tipo_publi where lista_tipo_publi
> > in ('palabras', 'negritas', 'sin cargo breves')
> > i get the result:
> >
> > 4
> > 9
> > 50
> >
> > But if I try with the quey:
> >
> > select lista_tipo_publi from lista_tipo_publi where lista_tipo_publi
> > in
> > (select'''||replace(tipos, ', ' , ''', ''')||'''' from lista_pautas
> > where id_pauta='6')
> >
> > I get 0 rows as result. Any idea about that. Is the IN clause working
> > wrong.
> >
> > Is there another way to do the same query without the IN clause.
> >
> > Thanks for your responses,
> >
> > Bye.
> >
> > --
> > Author: sergio
> > INET: smoriano_at_sicon.net
> >
> --
> Author: Stephane Faroult
> INET: sfaroult_at_oriolecorp.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
Received on Tue May 16 2000 - 02:03:11 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US