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 4066720
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:09:44+00:00 2026-05-20T16:09:44+00:00

I’m porting an excel database to a real database application and the customer wants

  • 0

I’m porting an excel “database” to a real database application and the customer wants to see familiar spreadsheet views showing data added across rows and summed down columns. Is this possible with a SQL querys? Or should the application be performing these aggregate calculations? I am writing the application in Java and Oracle for persistence.

Schema:
    CREATE TABLE CTC_COST_TO_COMPLETE (
    COST_TO_COMPLETE_ID VARCHAR2(24) NOT NULL,
    LINECODE VARCHAR2(16),
    DEPT VARCHAR2(6),
    YEAR VARCHAR2(4),
    SUPERVISOR VARCHAR2(9),
    JAN VARCHAR2(12),
    FEB VARCHAR2(12),
    MAR VARCHAR2(12),
    APR VARCHAR2(12),
    MAY VARCHAR2(12),
    JUN VARCHAR2(12),
    JUL VARCHAR2(12),
    AUG VARCHAR2(12),
    SEP VARCHAR2(12),
    OCT VARCHAR2(12),
    NOV VARCHAR2(12),
    DEC VARCHAR2(12),
             );

Each Line code stores the man hour estimates a supervisor needs per month

RAW:
id       Linecode     Dept    Year    Supervisor    Jan     Feb     Mar ... Dec
1        ED.312        400    2011      P13341       12      10      15 ...   6
2        GR.544        400    2011      P13341       23       5       1 ...   9
3        WV.132        400    2011      P13341        2       1      18 ...  16



Need out on web page:
  Linecode     Dept    Year    Supervisor    Jan     Feb     Mar ... Dec   Sub Total
  ED.312        400    2011      Rozycki      12      10      15 ...   6         135
  GR.544        400    2011      Rozycki      23       5       1 ...   9          76
  WV.132        400    2011      Rozycki       2       1      18 ...  16          89
 ====================================================================================
                                      Total   37      16      34 ...  31         300   

Views are a little more complicated than what I am showing. I may want to summarize totals by linecode for ALL supervisors, for instance.

Thanks.

  • 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-05-20T16:09:45+00:00Added an answer on May 20, 2026 at 4:09 pm

    This is best done outside of the database layer. For what it’s worth, you wouldn’t be storing it in row/column format as shown anyway (or shouldn’t) – in which case the tabulation only happens at the display layer.

    Use 2d arrays to store the data while rendering, and sum along the dimensions of the array to get row/column totals.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.