我被问到是否有更好的方法来编写此查询,我认为没有。请帮忙:
select bookid, bookname
from books
where bookname not like 'D%' or bookname not like 'F%'
最佳答案
SELECT bookid,
bookname
FROM books
WHERE bookname IS NOT NULL
维护原始查询的语义。也许您打算使用
AND
而不是OR
SELECT bookid,
bookname
FROM books
WHERE bookname NOT LIKE '[DF]%'