我在标准访问工作。我写了下面的代码:
SELECT *
FROM room
WHERE price < 40 AND
type IN ('Double", "Single")
ORDER BY price;
当我运行它时,它告诉我这个消息
查询表达式price <中的字符串语法错误;然后输入(' Double","Single"ORDER BY price;
SQL中的字符串文字由单引号表示,而不是双引号:
SELECT * FROM room WHERE price < 40 AND type IN ('Double', 'Single') ORDER BY price
单引号和双引号不能混用。另外,type
是一个保留字。所以尝试:
SELECT *
FROM room
WHERE price < 40 AND [type] IN ("Double", "Single")
ORDER BY price;