Q:

SELECT with JOIN And SUM in JPQL

I wanna do a query for extract information in a dashboard. I have two entities: User
and UserProfile.
User has a list of UserProfile.
I wanna get the sum of the points of all the UserProfile of a User.
I have this query:
SELECT u.id, u.name, SUM(u.points) FROM User u JOIN u.userProfiles up