table a
id_A''''''''''' ''''''''name
1'''''''''''''' ''''''''''''''t om
2'''''''''''''' ''''''''''''''f rank
3 ''''''''''''''' '''''''''john
table b:
id_A''''''''''''''' ''''''''''''''' '''''id_C'''''''''''points
1''''''''''''''' ''''''''''''''' ''''''''''''''' ''''1''''''''''''''' ''''''1
1''''''''''''''' ''''''''''''''' ''''''''''''''' ''''2''''''''''''''' ''''''5
1''''''''''''''' ''''''''''''''' ''''''''''''''' ''''3''''''''''''''' ''''''7
2''''''''''''''' ''''''''''''''' ''''''''''''''' ''''1''''''''''''''' '''' 5
2''''''''''''''' ''''''''''''''' ''''''''''''''' '' 2''''''''''''''' ''''''12
table C:
id_C, sport
i have to write query that have everything from table A with sum(points) for every person from B along with id_C and points for sport with highest score.table should lok like this:
id_A, name, sum(pts), max(pts), id_C for max(pts)
example for tom:
id_A:1
name:tom
sum(pts): 13
max(pts):7
idC for max(pts):3
id_A''''''''''' ''''''''name
1'''''''''''''' ''''''''''''''t om
2'''''''''''''' ''''''''''''''f rank
3 ''''''''''''''' '''''''''john
table b:
id_A''''''''''''''' ''''''''''''''' '''''id_C'''''''''''points
1''''''''''''''' ''''''''''''''' ''''''''''''''' ''''1''''''''''''''' ''''''1
1''''''''''''''' ''''''''''''''' ''''''''''''''' ''''2''''''''''''''' ''''''5
1''''''''''''''' ''''''''''''''' ''''''''''''''' ''''3''''''''''''''' ''''''7
2''''''''''''''' ''''''''''''''' ''''''''''''''' ''''1''''''''''''''' '''' 5
2''''''''''''''' ''''''''''''''' ''''''''''''''' '' 2''''''''''''''' ''''''12
table C:
id_C, sport
i have to write query that have everything from table A with sum(points) for every person from B along with id_C and points for sport with highest score.table should lok like this:
id_A, name, sum(pts), max(pts), id_C for max(pts)
example for tom:
id_A:1
name:tom
sum(pts): 13
max(pts):7
idC for max(pts):3
Comment