A view to show worked time per task per user?
it's better to add a userID to your worketime table instead of User and also the name user is reserved word so don't use it. The view you are looking for is made like this

CREATE VIEW user_task_time as select `user`,taskid,sec_to_time(sum(TIME_TO_SEC(TIMEDIFF(endwork,startwork)))) as timeWorked FROM worktime GROUP BY user,taskid;


TIMEDIFF() return a time value and it is converted to second and back to time because SUM() function does not return correct results when used by time data type.