I want to create a column in mysql workbench where there is a sum of the duration of a behaviour when multiple columns (e.g condition, trial, subject, behaviour type...) are the same.
I am relatively new to working in sql and have so far mostly just used it for extracting data. Is this something that is possible? If so how do I go about it?
Thanks :)
Edit - The data would be something like this
Condition Trial Group Subject Behaviour Duration **TotalDuration**
np 1 XX GBF132 interact 00:00:42
np 1 XX GBF132 interact 00:00:17
yp 1 ZZ HJR543 interact 00:01:03
yp 1 ZZ HJR543 interact 00:00:26
So there could be multiple interactions within a trial by the same individual and I would like to determine the overall interaction duration per trial.
But I have multiple subjects/behaviours/Groups per trial and condition so need a way to easily calculate the total duration of each behaviour when the condition, trial, group, subject, behaviour are the same .
I hope this makes it clearer!