Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8766529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:34:36+00:00 2026-06-13T16:34:36+00:00

I have a table, the data in it looks similar to this: user type

  • 0

I have a table, the data in it looks similar to this:

user  type       hours    used    --to make another column with this info    available

2334  sick       10.000   2.000                                              8.000
2334  vacation   48.000   56.000                                             -8.000
2334  personal   0        8.000                                              0
1356  sick       0        16.000                                             -16.000
1356  vacation   80.000   0                                                  80.000
1356  personal   14.000   14.000                                             0
4355  sick       4.000    1.000                                              3.000
4355  vacation   112.000  0                                                  112.000 
4355  personal   8.000    0                                                  8.000

I had to sum up the values in the hours column, but only for each user. So user 2334 would have earned 58.000 hours, 10.000 + 48.000 + 0 but would have used 66.000 hours resulting in -8.000 hours.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:34:38+00:00Added an answer on June 13, 2026 at 4:34 pm
    SELECT user, SUM(hours) totalHours
    FROM tableName
    GROUP BY user
    
    • SEE SQLFiddle Demo
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data in a table that looks similar to this: Item Date
I have a db table containing a column display_order . The data looks like
I have a lagre data frame which looks similar to this format: line1 line2<tab>value1
I have a table whose data looks like this: INSERT INTO `cm_case_notes` (`id`, `case_id`,
I am using Excel 2010. I have a monthly data table that looks similar
I have an excel sheet where in the data looks similar to the table
I have a table called Addim and the data looks like: TName Idate Number
I have some data in a table that looks roughly like the following: table
My table have data structure like this cate_id task_id date_start date_end other 34 14
I have data table containing one column as FilePath. FilePath D:\New folder\link.txt D:\New folder\SharepointMigration(Work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.