我被问到是否有更好的方法来编写此查询,我可以想到没有。请帮忙:
select bookid, bookname
from books
where bookname not like 'D%' or bookname not like 'F%'
答案 0 :(得分:14)
SELECT bookid,
bookname
FROM books
WHERE bookname IS NOT NULL
维护原始查询的语义。也许您打算使用AND
代替OR
SELECT bookid,
bookname
FROM books
WHERE bookname NOT LIKE '[DF]%'