mybatis错误:Operand should contain 1 column(s)

运行mybatis时报了org.apache.ibatis.exceptions.PersistenceException:

### Error querying database.  Cause: java.sql.SQLException: Operand should contain 1 column(s)

既然是sql报错,应该是sql语句写错了,然后我看了下语句发现少写了连接函数。

原句是这样的

select  * from t_user where user_name like concat('%',#{username},'%') and password like ('%',#{password},'%')

改为

select  * from t_user where user_name like concat('%',#{username},'%') and password like concat('%',#{password},'%')
正常




你可能感兴趣的:(mybatis)