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

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

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

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

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

 

发布了164 篇原创文章 · 获赞 38 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/corleone_4ever/article/details/104556986
今日推荐