0

I have a data frame that has multiple entries on the same day with a TSS score.

    athlete    workoutday   tss
1  Athlete_1   2020-03-20   30
2  Athlete_1   2020-03-20   21
3  Athlete_1   2020-03-20   64

I would like some help in knowing how to combine the tss scores into into a new column and be put into a new data frame so that there is only 1 entry for each athlete.

for example

    athlete    workoutday   tss
1  Athlete_1   2020-03-20   115
2  
3

Cheers

BigBird
  • 5
  • 3

1 Answers1

0

SELECT Athlete_1,workoutday, (select SUM(tss) from your_table where athlete='Athlete_1') as tss FROM your_table GROUP BY Athlete_1;

aswini
  • 16