1

我正在研究标准访问。我写了这段代码:

SELECT *
FROM room
WHERE price < 40 AND
type IN ('Double", "Single")
ORDER BY price;

当我运行它时,它告诉我这条消息

查询表达式中的字符串语法错误 price < 40 AND type IN ('Double", "Single") ORDER BY price;

4

2 回答 2

0

SQL 中的字符串文字用单引号表示,而不是双引号:

SELECT * FROM room WHERE price < 40 AND type IN ('Double', 'Single') ORDER BY price
于 2021-01-22T17:37:28.023 回答
0

您不能混合使用单引号和双引号。另外,type是一个保留字。所以试试:

SELECT *
FROM room
WHERE price < 40 AND [type] IN ("Double", "Single")
ORDER BY price;
于 2021-01-22T18:18:29.947 回答