tglaser Posted August 20, 2019 Share Posted August 20, 2019 Hello , i am struggling to identify how to add a summary row to a query I am implementing. I have 2 columns, Name, time worked, I want to identify two things; 1. the total time worked per name, and 2 the total time worked by everyone. Can you help ? Current Query: SELECT Name, sum(hours) AS Hours FROM timecard Group by Name; Goal shown below. Name Hours John 5 Mary 6 Ed 7 Total 18<----THIS IS THE ROW I NEED TO ADD!!! Link to comment Share on other sites More sharing options...
justsomeguy Posted August 21, 2019 Share Posted August 21, 2019 The sum would come from another query, although depending on which database you're using you can probably use subqueries to group the results from multiple queries into one result set. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now