“ALL"的 SQLite 语法 [英] SQLite syntax for "ALL"
问题描述
有没有办法在 SQLite 中执行以下操作?
Is there a way to do the following in SQLite?
select name
from table
where number >= ALL (<subquery, "such as select x from table ...">)
具体来说,无论我如何格式化查询,我都会在 ALL
运算符之后收到语法错误.在我搜索解决方案时,我发现有人提到 ALL
的语法在 SQLite 中有所不同,但我似乎无法弄清楚.
Specifically, I'm getting a syntax error after the ALL
operator, no matter how I format my query. In my googling for a solution, I found some mention that the syntax for ALL
is different in SQLite, but I can't seem to figure it out.
有人可以告诉我基本的 ALL (
语句在 SQLite 中是如何工作的吗?或者让我知道它们是否完全不起作用?
Can someone show me how a basic ALL (<subquery>)
statement works in SQLite? Or let me know if they don't work at all?
推荐答案
我怀疑是否存在 ALL() 运算符.但是,您可以使用 MAX() 和 MIN() 编写功能等效的内容.
I doubt that there is an ALL() operator in SQLite. However, you can write something that is functionally equivalent using MAX() and MIN().
SELECT name
FROM table
WHERE number >= (SELECT MAX(another_number) FROM another_table WHERE ...)
这篇关于“ALL"的 SQLite 语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!