org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2

 

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyR

 分析报错,主键查询,但是查出来条数是两条

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyR

问题所在是left join关联查询,行程笛卡尔成绩

关联的表中,如果符合条件的不止一条记录,就会存在这个问题,那么加个distinct去重即可解决

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyR 

相关文章:

  • 2021-08-07
  • 2022-12-23
  • 2021-11-09
  • 2021-10-11
  • 2021-04-18
  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
猜你喜欢
  • 2021-12-26
  • 2021-09-06
  • 2021-12-30
  • 2021-08-21
  • 2022-01-02
相关资源
相似解决方案