问个条件查询and 和or的问题
SELECT content, talker, toobject, thetime, issingle
FROM chatrecord
WHERE (a <= ?) AND (b = '1 ') AND ((c = ?) OR
(d = ?)) ORDER BY thetime DESC
语句如上,功能是查询chatrecord表中同时满足条件a和b,而c与d中的任一个
改如何修改上面的语句呢
[解决办法]
1、将记录及正确结果贴出来;
2、
满足条件a和b,而c与d中的任一个
(a and b )
(c or d)
这两种条件是AND 还是 OR
[解决办法]
--满足a、b,且满足c、d的其中一个
where a=1 and b=2 and (c=3 or d=4)