Error: more than one row returned by a subquery used as an expression

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>

Read More: