简体   繁体   中英

SQL Logic Operator Precedence Or and ()

I am changing this

(NVL(N.col1,'-') <> NVL(O.col1,'-')) OR
(NVL(N.col2,-1) <> NVL(O.col2,-1)) 

to

NVL(N.col1,'-') <> NVL(O.col1,'-') OR
NVL(N.col2,-1) <> NVL(O.col2,-1) OR

in a trigger's when clause as it is exceeding the size allowed. I removed the brackets. Can anybody please confirm the operator that there will not be any impact? Also please provide if any documentation on operator precedence is available.

Thanks in advance.

Yes, with or without the brackets, the result should be the same, in all SQL products that conform with the SQL standard.

The precedence of comparison operators, like <> , is higher than logical operators, like AND .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM