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

  • Home
  • SEARCH
  • 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 8278155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:54:46+00:00 2026-06-08T08:54:46+00:00

i would like to compute the data from a table where it consists date,

  • 0

i would like to compute the data from a table where it consists date, and data ..there are a lot of data inside the table. example are as below:

DATE       hour  data1  data2
-------------------------------
01/01/2010  1    10860  1234    
01/01/2010  2    10861  1234    
01/01/2010  3    10862  1234    
01/01/2010  4    10863  567   
01/01/2010  5    10864  458    
02/01/2010  1    10865  3467    
02/01/2010  2    10866  7890    
02/01/2010  3    10867  863    
02/01/2010  4    10868  0    
02/01/2010  5    10868  698  
03/01/2010  1    10868  4693  
03/01/2010  2    10868  7853  
03/01/2010  3    10868  5987

and from above data. i would like to compute it into a table like this:

DATE           sdata1  sdata2
-------------------------------
01/01/2010     54310   4727    
02/01/2010     54334   12918    
03/01/2010     32604   18533

the sdata1 and sdata2 are the sum of the data that computed … is there any way for me to compute the data into above data display? thank you … hehe …

  • 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-08T08:54:49+00:00Added an answer on June 8, 2026 at 8:54 am
    SELECT DATE, SUM(data1) AS sdata1, SUM(data2) AS sdata2 FROM table1 GROUP BY DATE;
    

    Try this and let me know if that is what you’re looking for. You can also use the WHERE DATE BETWEEN startDate AND endDate if you needed a range.


    Another trick if you wanted this data in another table to do “stuff” with, would be to:

    CREATE TABLE table2 (SELECT DATE, SUM(data1) AS sdata1, SUM(data2) AS sdata2 FROM table1 GROUP BY DATE);
    

    This will perform query above but create a new table with the results. I’m not sure why you might need that but sometimes de-normalizing and having computed information in a table for display can speed up your app.


    If you have a table already then you can do the following:

    INSERT INTO table2 (DATE, sdata1, sdata2) VALUES (SELECT DATE, SUM(data1) AS sdata1, SUM(data2) AS sdata2 FROM table1 GROUP BY DATE);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i would like to compute the data from a table where it consists date,
I have data that I would like to compute some statistics with. The data
I would like to use a Groovy closure to process data coming from a
I have to related tables like in the example script below: -- Creating table
I would like to import some basic data (only few integers) from an Excel
For given floating point numbers x and a , I would like to compute
Would like to parse IPv4 address from exit-addresses . Format of the file: ExitNode
My table records is like below ym cnt 200901 57 200902 62 200903 67
i would like to play with the constructing calls feature of gcc... From the
I receive data from a WCF and bind it to a table. I have

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.