[Spring] TooManyResultException: Expected one result(or not) to be returned by selectOne(), but found: 3
에러 발생TooManyResultException: Expected one result(or not) to be returned by selectOne(), but found: 31개의 결과만 출력되어야 하는데 3개의 결과가 찾아지는 문제가 발생보통은 list를 할텐데 list는 다른 쿼리로 뽑고 있어서 할 필요가 없었음그래서 서브 쿼리를 select max() from 을 써서 결과가 잘 나오나 봄.ex ) select id, point, charge, email, phone_number from select( max(id), max(point), max(charge), max(email), max(phone_number) from user u join payment p on u.id = p.id)..
2024. 3. 2.