Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
IN() sql 语句的反义词是什么。我将如何构建以下语句以提取除 2,5 和 6 之外的所有记录。“!” 在 IN 不起作用之前。
$sql = "SELECT * FROM table WHERE column IN('2','5','6')";
$sql = "SELECT * FROM table WHERE column NOT IN('2','5','6')";
编辑 :
正如评论中的“onedaywhen”和“ypercube”所指出的,
对于Null Allowed列,您可能需要添加
OR column IS NOT NULL
或者
OR column IS NULL