gpt4 book ai didi

SQL 逻辑运算符

转载 作者:行者123 更新时间:2023-12-04 13:38:43 24 4
gpt4 key购买 nike

有哪些不是学生、律师或教育 worker 的职业?按字母降序列出它们?

SELECT Occupation 
FROM Viewer
WHERE occupation NOT IN 'student,lawyer,educator'
ORDER BY occupation desc;

我一直收到错误。我做错了什么?

最佳答案

IN 需要用括号括起来的表达式列表:

SELECT Occupation
FROM Viewer
WHERE occupation NOT IN ('student','lawyer','educator')
ORDER BY occupation desc;

参见 documentation for IN查看正确的语法:

IN condition

关于SQL 逻辑运算符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13315376/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com