Reputation: 22180
Does anyone know if there are some significant changes concerning operator precendence between Oracle 9 and Oracle 10?
AND / OR seems to be treated diffently in 9 compared to 10.
Upvotes: 2
Views: 1205
Reputation: 4148
9I and 10G both have AND as having a higher precedence than OR (According to these URL's)
This URL does list a few changes in the PL/SQL compiler evaluation, but the changes are not related to AND or OR: http://oraclefunda.wordpress.com/2008/06/18/plsql-enhancements-in-oracle-database-10g/
REFERENCES (AND and OR evaluation):
10G:
PL/SQL When PL/SQL evaluates a boolean expression, NOT has the highest precedence, AND has the next-highest precedence, and OR has the lowest precedence. However, you can use parentheses to override the default operator precedence.
9I: http://docs.oracle.com/cd/B10501_01/appdev.920/a96624/02_funds.htm#3860 HIGHEST: **, +, -, *, /, +, -, ||, =, <, >, <=, >=, <>, !=, ~=, ^=, IS NULL, LIKE, BETWEEN, IN, NOT, AND, OR
Upvotes: 2
Reputation: 36798
According to the manuals, there is no difference between condition precedence in 9i and 10g. (Assuming you meant conditions, and not operators. For operators the story is the same, except 10g has a new operator, connect_by_root
.)
Here is the precedence, ordered from high to low:
SQL operators are evaluated before SQL conditions
=, !=, <, >, <=, >=,
IS [NOT] NULL, LIKE, [NOT] BETWEEN, [NOT] IN, EXISTS, IS OF type
NOT
AND
OR
As @Rajesh Chamarthi mentioned, changing this would cause all kinds of problems, and I've never encountered precedence differences between versions.
But it wouldn't surprise me if there were some specific bugs, or some rare ambiguous statements that are treated differently.
Upvotes: 1