Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 playing about with the AND and OR conditions

Author  Topic 

luke nukem
Starting Member

5 Posts

Posted - 2007-07-26 : 12:09:10
Hi folks, basically I'm looking for this sort of structure

WHERE (caseA AND caseB) OR (caseC AND caseD) OR (CaseA AND caseD)

but I can't seem to be able to group the AND conditions together any time I try put brackets in SQL Server Enterprise manager removes them on me,

any help would be great,

thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-26 : 12:11:44
That's because the brackets are not needed!
AND has precedence over OR.

Read about operator precedence in Books Online.



E 12°55'05.76"
N 56°04'39.42"
Go to Top of Page
   

- Advertisement -