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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:23:01+00:00 2026-05-30T12:23:01+00:00

I have the following data: SUM_OF_ALL_PUSHES | USER_LOGIN | COMPONENT_NAME | ROW_LST_UPD_TS ——————-|—————|——————-|————————- 61

  • 0

I have the following data:

SUM_OF_ALL_PUSHES  |   USER_LOGIN  |   COMPONENT_NAME  | ROW_LST_UPD_TS
-------------------|---------------|-------------------|-------------------------
61                 |   DOMAIN\abc  |   Component A     | 22/02/12 12:58:26.325 PM
14                 |   DOMAIN\xyz  |   Component B     | 22/02/12 05:20:52.565 PM
17                 |   DOMAIN\xyz  |   Component A     | 22/02/12 05:21:58.045 PM
34                 |   DOMAIN\abc  |   Component A     | 22/02/12 05:44:20.274 PM
38                 |   DOMAIN\abc  |   Component A     | 22/02/12 06:28:41.465 PM

I’m deriving the the data using the following:

SELECT SUM(Q.SUM_OF_ALL_PUSHES) AS SUM_OF_ALL_PUSHES, Q.USER_LOGIN, Q.COMPONENT_NAME, Q.ROW_LST_UPD_TS FROM( SELECT                
    SUM(REGEXP_SUBSTR(SUBSTR(EVENT_MSG, INSTR(EVENT_MSG, ' ', 1,1), INSTR(EVENT_MSG, ' ', 1,1)) , '[0-9]+')) AS "SUM_OF_ALL_PUSHES", 
    USER_LOGIN,
    COMPONENT_NAME, 
    EVENT_MSG, 
    ROW_LST_UPD_TS
FROM EVENT_MGT.EVENT_LOG
WHERE
ROW_LST_UPD_TS BETWEEN TRUNC(SYSDATE - 1) AND TRUNC(SYSDATE) - 1/86400
AND SUBSTR(EVENT_MSG,1 ,INSTR(EVENT_MSG, 'd', 1,1)) = 'Received'
GROUP BY 
    USER_LOGIN, 
    COMPONENT_NAME, 
    EVENT_MSG, 
    ROW_LST_UPD_TS) Q
GROUP BY COMPONENT_NAME, USER_LOGIN, ROW_LST_UPD_TS 
ORDER BY ROW_LST_UPD_TS ASC

The issue is that I need to sum the numbers for each user by component. So in the results set above, I need to aggregate columns 1, 4 and 5 and add up the values for SUM_OF_ALL_PUSHES since the records each have user abc, and Component A.

So in summary, I need to remove the data duplication in the other columns, and sum the values in the first column based on user and component. So the result set should look like this:

SUM_OF_ALL_PUSHES  |   USER_LOGIN  |   COMPONENT_NAME  | ROW_LST_UPD_TS
-------------------|---------------|-------------------|-------------------------
133                |   DOMAIN\abc  |   Component A     | 22/02/12 12:58:26.325 PM
14                 |   DOMAIN\xyz  |   Component B     | 22/02/12 05:20:52.565 PM
17                 |   DOMAIN\xyz  |   Component A     | 22/02/12 05:21:58.045 PM 

Please help.

  • 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-30T12:23:02+00:00Added an answer on May 30, 2026 at 12:23 pm

    Sounds like you don’t want to group by the timestamp, but instead apply an aggregate function (I’m guessing MAX) to it.

    SELECT SUM(Q.SUM_OF_ALL_PUSHES) AS SUM_OF_ALL_PUSHES, Q.USER_LOGIN, Q.COMPONENT_NAME, MAX(Q.ROW_LST_UPD_TS) FROM( SELECT                
        SUM(REGEXP_SUBSTR(SUBSTR(EVENT_MSG, INSTR(EVENT_MSG, ' ', 1,1), INSTR(EVENT_MSG, ' ', 1,1)) , '[0-9]+')) AS "SUM_OF_ALL_PUSHES", 
        USER_LOGIN,
        COMPONENT_NAME, 
        EVENT_MSG, 
        ROW_LST_UPD_TS
    FROM EVENT_MGT.EVENT_LOG
    WHERE
    ROW_LST_UPD_TS BETWEEN TRUNC(SYSDATE - 1) AND TRUNC(SYSDATE) - 1/86400
    AND SUBSTR(EVENT_MSG,1 ,INSTR(EVENT_MSG, 'd', 1,1)) = 'Received'
    GROUP BY 
        USER_LOGIN, 
        COMPONENT_NAME, 
        EVENT_MSG, 
        ROW_LST_UPD_TS) Q
    GROUP BY COMPONENT_NAME, USER_LOGIN 
    ORDER BY MAX(Q.ROW_LST_UPD_TS) ASC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following data frames > head(elo) date elo 1 1921-12-18 1597 2 1922-05-14
I have following data structure (simplified): A giant list of the class TestClass public
I have following data to save in database using php my data is :
I have following data in my table. alt text http://img26.imageshack.us/img26/3746/productfield.png I want to extract
I have following data in excel table r1 r2 r3 r4 r5 v1 v2
I have following data in a file called binFile 78 1 79 4 80
I have following data: a=[3 1 6]'; b=[2 5 2]'; c={'ab' 'bc' 'cd'}'; I
I have the following data inside an NSData object: <00000000 6f2d840e 31504159 2e535953 2e444446
I have the following data from 2 tables Notes (left) and scans (right) :
I have the following data X Y INFTIME 1 1 0 1 2 4

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.