我正在尝试从我们的客户服务查询中选择一些消息,其中 Mmessage 所有者是 ABC,数据是 LIKE ABCDEF 和消息......并且消息是从客户到 CSservice 或从 CSservice 到客户。
我怎样才能做到这一点?
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