Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在研究标准访问。我写了这段代码:
SELECT * FROM room WHERE price < 40 AND type IN ('Double", "Single") ORDER BY price;
当我运行它时,它告诉我这条消息
查询表达式中的字符串语法错误 price < 40 AND type IN ('Double", "Single") ORDER BY price;
SQL 中的字符串文字用单引号表示,而不是双引号:
SELECT * FROM room WHERE price < 40 AND type IN ('Double', 'Single') ORDER BY price
您不能混合使用单引号和双引号。另外,type是一个保留字。所以试试:
type
SELECT * FROM room WHERE price < 40 AND [type] IN ("Double", "Single") ORDER BY price;