Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    17

    Question Unanswered: How to get summed data from 2 diff. Tables not related Logically

    Hi,

    My prob. may seem simple for u but it's a problem for me.....

    there is two different table with only column..
    create table amoun1(amt number(5))

    create table amoun2(amt number(5))

    now i hev inserted 4 rows in first table (amount1) 20,20,20,20 and
    i hev inserted 4 rows in second table (amount2) 30,30,30,30

    i want result in this format....

    sum(amount1.amt) sum(amount2.amt)

    expected result is.........
    80 120

    but.....i tried all possibilities.....but not finding the optimum solutions.....

    so pls reply with the optimum solution.......

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Code:
    select
      ( select sum(amt) from amount1 ) amount1_sum
    , ( select sum(amt) from amount2 ) amount2_sum
    from dual;

  3. #3
    Join Date
    Jan 2004
    Posts
    17

    Red face Thanks....

    Thanks Dear.....
    for ur kind help...........

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •