mysql – 操作数应该包含java中的1列
作者:互联网
参见英文答案 > MySQL Syntax error message “Operand should contain 1 column(s)” 5个
String sql = "SELECT (Employee_name, Password) FROM employee WHERE (Employee_name = '"+name+"' AND Password = '"+password+"')";
并在JSP中获得以下异常
java.sql.sqlexception插入操作数应包含1列
请帮忙.
解决方法:
正确的方法是
String sql = "SELECT Employee_name, Password FROM employee WHERE Employee_name = '"+name+"' AND Password = '"+password+"'";
您可以在where子句中使用keep(),但不能在select列表中使用.
这就是你的情况
mysql> select (firstname,email) from users limit 1 ;
ERROR 1241 (21000): Operand should contain 1 column(s)
标签:mysql,mysql-error-1241 来源: https://codeday.me/bug/20190823/1695628.html