I am querying 2 tables in a database. I want to add the values of the hours_worked field if a user displays on the same day more than once. This is what I have started with:
SELECT name, date_worked, hours worked
FROM users u
INNER JOIN records r
ON u.id = r.users_id
.......
That’s as far as I get. Any help with the SQL syntax on how to do this would be awesome?
just aggregate it using
SUM