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

Home -> Community -> Usenet -> c.d.o.server -> Re: SELECT - parenthesis ignored by Oracle ???

Re: SELECT - parenthesis ignored by Oracle ???

From: Syltrem <syltrem_at_videotron.pas.de.spam.ca>
Date: Fri, 14 Dec 2001 12:59:35 -0500
Message-ID: <N6rS7.14675$a5.581989@wagner.videotron.net>


I understand you, but the statement is generated by an ODBC and I can`t control it.
Furthermore your method, although returning the correct result, will not make good use of the index and my table has 6 million rows, 1.5 million for that particular warehouse.

I thought it over, and indeed it`s a logic error. It has to be:
AND not (PERIOD=10 AND YEAR=2001)

Using the negation (not equal to) inside the parenthesis is just confusing. I`ll see how to make the calling language do this instead.

Thanks!

"2 posti secchi" <Anguilla99_at_libero.it> a écrit dans le message news: 5kqS7.2046$7%3.44421_at_twister1.libero.it...
> Hi!
>
> It is not a parenthesis problem, it is a logic problem!
>
> try this:
>
> select distinct(year || period)
> from IC_BIN_MOVEMENTS
> WHERE WAREHOUSE='SF'
> AND PERIOD||YEAR <>'102001';
>
>
>
> Syltrem <syltrem_at_videotron.pas.de.spam.ca> wrote in message
> d7qS7.14057$a5.560440_at_wagner.videotron.net...
> > I do
> > select distinct(year || period)
> > from IC_BIN_MOVEMENTS
> > WHERE WAREHOUSE='SF'
> > AND (PERIOD<>10 AND YEAR<>2001);
> >
> > That is, I want all rows where warehouse = SF and the date is not
october
> > 2001.
> > What it returns is all rows for warehouse SF where the period is not 10
> (of
> > any year) and year is not 2001.
> > As a result I get all months except october for every year, and nothing
at
> > all for the whole year 2001.
> >
> > Why are the parenthesis ignored?
> >
> > Thanks!
> >
> >
>
>
Received on Fri Dec 14 2001 - 11:59:35 CST

Original text of this message

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