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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:00:10+00:00 2026-06-06T01:00:10+00:00

I have 5 tables: TABLE_A: A_ID TABLE_B: A_ID B_ID TABLE_C: B_ID C_ID C_SOME_NUMBER TABLE_D:

  • 0

I have 5 tables:

TABLE_A:
    A_ID

TABLE_B:
    A_ID
    B_ID
TABLE_C:
    B_ID
    C_ID
    C_SOME_NUMBER

TABLE_D:
    A_ID
    D_ID
TABLE_E:
    D_ID
    E_ID
    E_SOME_NUMBER

As you can see, the mapping relationships are:

1 A --> n B
1 B --> n C
1 A --> n D
1 D --> n E

I want to write a SQL to calculate: the count of A_ID that:

sum(C_SOME_NUMBER) != sum(E_SOME_NUMBER)

But I don’t know how to write this sql. My DB is Oracle

  • 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-06T01:00:13+00:00Added an answer on June 6, 2026 at 1:00 am
    select
        count(Q1.ID) as 'whoopsie'
    from
        (
            select
                a.ID,
                sum(c.some_number) as someNum
            from
                TA a,
                TB b,
                TC c
            where
                a.ID=b.IB
                and b.ID=c.ID
            group by
                a.ID
        ) Q1,
        (
            select
                a.ID,
                sum(e.some_number) as someNum
            from
                TA a,
                TD d,
                TE e
            where
                a.ID=d.IB
                and d.ID=e.ID
            group by
                a.ID
        ) Q2
    where
        Q1.ID=Q2.ID
        and Q1.someNum != Q2.someNum
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two similar tables table_a and table_b table_a is my current data and
I have 2 tables Table_A and Table_B. Table_A is a parent of Table_B. Table_B
I have two tables Table_A and Table_B and i want to join those tables
I have two tables, structured like so: table A: A_ID varchar(32) PRIMARY KEY field1
I hope I can explain this clearly: I have two tables with the following
In our DB we have two tables A, B with primary keys A_id and
I have two tables like this. Table A A_ID ( Primary Key) A1 A2
i have 3 tables A,B and C. table A has column employee_name,id table B
I have two tables: A and B. Table A : Id | Number 1
Say I have two tables called A (fields: id, phase, name) and B(fields: id,

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.