Reason for error: There are multiple pieces of data with ID =1, but the code USES a single value to receive it.
Case study: Query the user whose age is 1. There are a lot of users in the database whose age is 1, but the code is received with an int, which causes this error to occur
dao: public int get(int age);
xml:
<select id = “get” resultType=“java.lang.Integer”>
select age from user where age = 1;
</select>
The correct code is:
dao: public List<Integer> get(int age);
xml:
<select id = “get” resultType=“java.lang.Integer”>
select age from user where age = 1;
</select>
div>
Read More:
- About MySQL error: subquery returns more than 1 row
- Handling of expression not in group by key [value] reported by hive on October 12, 2020
- Error Code: 1055. Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated
- error Expected an assignment or function call and instead saw an expression
- MySQL error code 1217 (ER_ROW_IS_REFERENCED): Cannot delete or update a parent row: a foreign key co
- Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and co
- The Vue project is packaged and deployed to tomcat, and an Error 404 is reported as soon as it is refreshed
- When the mybatis field contains an expression, an error is reported when it is stored in the database
- where in subquery source [How to Solve]
- The remote server returned an error: (417) Expectation failed
- The remote server returned an error: notfound when Silverlight calls WCF service
- Chrome console reports Failed to load resource: net::ERR_BLOCKED_BY_CLIENT one of the solutions
- Matlab delete row or col to delete the row or column of the matrix
- E: sub process / usr / bin / dpkg returned an error code (2) solution under Ubuntu
- The as reported an error and could not find ninja
- E: Sub process / usr / bin / dpkg returned an error code (1) solution
- When C language refers to a user-defined type as a parameter, an error segmentation fault is reported
- error PRJ0019: A tool returned an error code from “Performing Post-Build Event…”
- The solution of running switchhosts as an administrator in win10
- error C2057: expected constant expression (Can the size of an array in C language be defined when the program is running?)