Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQL Help Urgent!!!!!!!!!

Re: SQL Help Urgent!!!!!!!!!

From: <sree_at_prasadvideo.com>
Date: Sun, 12 May 2002 23:18:19 -0800
Message-ID: <F001.0045F21E.20020512231819@fatcity.com>


Hello sultan

You can create a view for the cc table and use with the bb table to display the output .

create view cc_view as select id, sum(amount) amt from cc group by id

select a.id,a.amount ,b.amount from bb a,cc_view b where a.id=b.id;

Hope this solution work's for u.

I will also try without using view .

Regards

Sreeraman

  Hi gurus

  I have two tables like this

  SQL> select * from bb;

          ID AMOUNT DT

  SQL> select * from cc;

          ID AMOUNT

  My query like this



  SQL> select a.id,sum(a.amount),sum(b.amount) from bb a,cc b where     2 a.id=b.id
    3 group by
    4 a.id;
          ID     SUM(A.AMOUNT)     SUM(B.AMOUNT)
          ---------- ------------- ----------------------------------------
           1          3000                     1000


  But my output should be like this


          ID     SUM(A.AMOUNT)     SUM(B.AMOUNT)
          ---------- ------------- ----------------------------------------
           1          1000                     1000


  Anybody can help me in this issue please.

  Regards.
  syed

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: sree_at_prasadvideo.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Mon May 13 2002 - 02:18:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US