运算符“ANY"的 SQLite 语法 [英] SQLite syntax for operator “ANY”
本文介绍了运算符“ANY"的 SQLite 语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在 SQLite 中执行此查询:
I'm trying execute this query in SQLite:
SELECT *
FROM customers
WHERE rating = ANY
(SELECT rating
FROM customers
WHERE city = 'Rome');
但收到此错误:
Query Error: near "SELECT": syntax error Unable to execute statement
如果我更换rating = ANY
rating IN
,一切正常.
If I replace
rating = ANY
to rating IN
, everything works fine.
有人可以告诉我 ANY 语句在 SQLite 中的工作原理以及我做错了什么吗?
Can someone show me how ANY statement works in SQLite and what I am doing wrong?
推荐答案
AFAIK,SQLite 没有 ANY
运算符.但是,您可以使用 IN
运算符来获得所需的功能:
AFAIK, SQLite doesn't have an ANY
operator. You could, however, use the IN
operator to get the required functionality:
SELECT *
FROM customers
WHERE rating IN -- Here!
(SELECT rating
FROM customers
WHERE city = 'Rome');
这篇关于运算符“ANY"的 SQLite 语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文