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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:37:43+00:00 2026-05-31T09:37:43+00:00

I have this table as a result from another query STATUS R1 R2 R3

  • 0

I have this table as a result from another query

STATUS          R1  R2  R3  R4  R5  R6  R7  R8  R9
----------------------------------------------------
ACCEPTED        322 241 278 473 575 595 567 449 605
ADECUACIONES    0   0   0   0   2   0   1   0   50
AET             0   0   2   0   0   0   0   0   11
EXECUTED        0   80  1   18  9   57  34  30  20
IN PROCESS      0   0   0   0   0   4   25  2   112
FREQ            0   55  2   76  25  117 7   73  48
INSTALL         1   4   1   10  5   14  2   13  62
WO INSTALL      9   2   51  24  143 17  15  59  16
WOT VL          0   1   0   0   1   0   0   0   0
OTHER          22   7   20  28  44  30  6   6   109
PROG            1   0   1   0   0   2   3   0   0
PTE PROG        0   5   0   0   0   0   3   19  93
TMX             0   0   0   28  4   8   11  3   14
PROJ            0   1   12  26  13  8   0   2   4

What I expect to have is this

STATUS          R1  R2  R3  R4  R5  R6  R7  R8  R9  TOTAL
----------------------------------------------------------
ACCEPTED        322 241 278 473 575 595 567 449 605 4105
ADECUACIONES    0   0   0   0   2   0   1   0   50  53
AET             0   0   2   0   0   0   0   0   11  13
EXECUTED        0   80  1   18  9   57  34  30  20  249
IN PROCESS      0   0   0   0   0   4   25  2   112 143
FREQ            0   55  2   76  25  117 7   73  48  403
INSTALL         1   4   1   10  5   14  2   13  62  112
WO INSTALL      9   2   51  24  143 17  15  59  16  336
WOT VL          0   1   0   0   1   0   0   0   0   2
OTHER          22   7   20  28  44  30  6   6   109 272
PROG            1   0   1   0   0   2   3   0   0   7
PTE PROG        0   5   0   0   0   0   3   19  93  120
TMX             0   0   0   28  4   8   11  3   14  68
PROJ            0   1   12  26  13  8   0   2   4   66
TOTAL           355 396 368 683 821 852 674 656 1144 5949

I’ve been playing with grouping() and rollup(), but I always get duplicated rows and unwanted null values.

  • 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-31T09:37:46+00:00Added an answer on May 31, 2026 at 9:37 am

    If you have problems, grouping_id function will help you.

    (You can select grouping_id(col), but also grouping_id(col1, col2, col3, etc..))

    But your case is simpler.

    It is like:

    drop table fg_test_group;
    create table fg_test_group (a number, b number, c number, d number);
    
    insert into fg_test_group values (1, 2, 3, 4);
    insert into fg_test_group values (2, 2, 3, 4);
    insert into fg_test_group values (3, 2, 3, 4);
    
    
    select  nvl(to_char(a), 'total') as a , sum(b), sum(c), sum(d), grouping_id(a)
    from fg_test_group
    group by rollup (a) 
    ;
    

    where a is Status in your case.

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

Sidebar

Related Questions

Let's say we have this query SELECT * FROM table And this result from
I have a testdata like this: DROP TABLE SELECT_PASS; CREATE TABLE SELECT_PASS(ID INT(20),TESTCASE VARCHAR(20),RESULT
I have a table in mysql like this Name Result T1_09_03_2010 fail T2_09_03_2010 pass
I would like to generate a table (or query result) in this form +---------------------+---------------------+
I have an Oracle table with data that looks like this: ID BATCH STATUS
Hi i have the following query/table from a local bookstore $queryadmin =SELECT last_name, first_name,
Q: I have a DataTable result from the following query: SELECT UNIQUE a.crsnum_e ,
Say I have this query: SELECT name::text, id::int, pass:bool FROM mytable; which gives me
I have jQuery code which looks something like this on Button1 Click $('table.result_grid tbody
I have a table which stores test results like this: user | score |

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.