I am having a table in SQL which is containing 2 points for 1 student\_id in one match like in below Photo[![enter image description here](https://i.stack.imgur.com/FKnu4.png)](https://i.stack.imgur.com/FKnu4.png)

Now Like this there are many **Student\_profile\_ID** and **Basketball\_Match\_ID**. And I want to make the Student\_profile\_ID same and then add the points after That want to Get Who Score the Maximum point among them.

I am Able to Sum then But NOt able to GET the MAX value 

```
SELECT student_profile_id,
       sum(point) as total_point 
from `basketball_points` 
where student_profile_id = {$value2} 
  AND basketball_match_id = {$key3}

```

Where Foreach Loop help me to increment the Value In PHP. And check all the results