🔍
🏠
Stack Overflow
🎲
Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
SQL brackets in where condition needed?
Asked
Feb 18 '19 at 15:03
Active
Feb 18 '19 at 15:03
Viewed
63 times
1
a AND b or c AND b
is equal to
(a AND b) or (c AND b)
in a SQL where condition right?
sql
oracle
logic
asked Feb 18 '19 at 15:03
TimoBue
11
1
7
Exactly. AND has higher precedence than OR.
–
jarlh
Feb 18 '19 at 15:05
4
I'd still use the brackets though, makes your SQL easier to read.
–
OTTA
Feb 18 '19 at 15:08
3
For given example, both are same. but its always preferred to use brackets
–
Vijiy
Feb 18 '19 at 15:12
0 Answers
0