【发布时间】:2014-11-21 10:24:52
【问题描述】:
我有一个不断返回错误的 mysql 查询
错误:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' iOS= 0, Android= 0, sport IN (football,tennis,' at line 2
整个查询是
INSERT INTO table2
SELECT *
FROM table1
WHERE iOS = 0
, android = 0
, sport IN (football,tennis,golf)
(iOS 和 android 列是布尔值,而运动是 VARCHAR)
该查询旨在获取 iOS/android 列为 0 且运动列值为足球或网球或高尔夫的所有条目。
哪里出错了?感谢您的帮助
【问题讨论】:
-
使用
AND代替逗号来构建您的条件
标签: mysql