title: SQL AND OR query
body: <p>I am trying to select some messages from our customer service queries, WHERE Mmessage owner is ABC, data are LIKE ABCDEF AND message ... AND where the message is either from Customer to CSservice or from CSservice to Customer. </p>
  
  <p>How can I do that?</p>
  
  <pre><code>SELECT Date, From, To, Data 
  FROM Ccustomers WITH (NoLock)
  WHERE MSGowner = 'ABC' AND Data LIKE '%ABCDEF%' AND 
  ([From] ='Customer' AND [To] = 'CSservice') OR ([From] ='CSservice' AND [To] = 'Customer') 
  
  ORDER by Date
  </code></pre>