Lets tell I have two tables.

```
CREATE TABLE user (ID int AUTO_INCREMENT,PRIMARY KEY (ID));
CREATE TABLE points (ID int AUTO_INCREMENT, user_id int, points int,PRIMARY KEY (ID));

```

How can I use spring-boot jpa to request user and max points like this?

```
select u.ID,max(p.points) from user u, points p where u.id=p.user_id

```

Or any alternatives to solve this kind of problems?