Hi @coder rock
For this type of question, you help yourself a lot if you post CREATE TABLE statements for your tables, together with INSERT statements with sample data and the desired result of the given sample. This makes it easy to copy and paste into a query window to develop a tested query and helps to give us better understanding of the problem.
Regarding this issue, it seems you need a total calculation for each employee. You could have a try on
GROUP BY ROLLUP
or GROUP BY GROUPING SETS ()
.
Best regards,
Cosmog Hong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.