标签: mysql
在MySQL中有更简洁的方法来执行此查询吗?
SELECT * FROM table WHERE id != 1 AND id != 2 AND id != 7
像:
SELECT * FROM table WHERE id != (1,2,7)
答案 0 :(得分:23)
SELECT * FROM table WHERE id NOT IN (1,2,7)