使用此工具时出现问题:
WARN com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'WHERE Accounts.UUID = WarAccounts.UUIDAND Accounts.UUID = 'c7a00fe7-826d-46da-b4' at line 1
这是SQL:
SELECT
*
FROM
Accounts,
WarAccounts
WHERE
Accounts.UUID = WarAccounts.UUID
AND Accounts.UUID = ?
(使用准备好的语句)
对于造成问题的问题我很困惑,我已经用它搜索了一下,但是找不到任何东西,因为这似乎是正确的方法。
服务器类型:MySQL 服务器版本:5.5.58-0ubuntu0.14.04.1-(Ubuntu)
答案 0 :(得分:0)
野驴猜想:
在C#中,我会这样做:
string query = "SELECT *" +
"FROM MYTABLE" +
"WHERE 1=1"
..得到您的错误..
连接字符串,您将看到问题:
"SELECT *FROM MYTABLEWHERE 1=1"
附加条件应为:
string query = "SELECT * " +
"FROM MYTABLE " +
"WHERE 1=1 "
(查看每行末尾的空格吗?)