Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SELECT - parenthesis ignored by Oracle ???
If you don't want columns concatenated, as suggested in other replies,
you could use
AND NOT (PERIOD = 10 AND YEAR = 2001) the form that most literally follows your specifications, which rewrites to
AND (PERIOD <> 10 OR YEAR <> 2001)
Which says: as long as PERIOD <> 10 or YEAR <> 2001, because you want to exclude the situation where both PERIOD = 10 and YEAR = 2001.
Jaap.
On Fri, 14 Dec 2001 11:51:48 -0500, "Syltrem" <syltrem_at_videotron.pas.de.spam.ca> wrote:
>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 Sun Dec 16 2001 - 04:04:46 CST