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

Home -> Community -> Usenet -> c.d.o.server -> Complex qry

Complex qry

From: <prince_kumar_at_my-deja.com>
Date: 2000/06/29
Message-ID: <8jfvi0$ibs$1@nnrp1.deja.com>#1/1

Hi:

I have the following two tables,

c_table:

login_id c_id c_tot


10            10        10
10            20        20
20            10        300
30            20        100
30            40        250


g_table:

login_id g_id g_tot


10            15        150
10            18        250
30            15        400
30            25        250


The first two columns in each table makes the primary key.

I want to calculate the sum of c_tot from c_table, sum of g_tot from g_table for each login_id.

My result should look like the following one,

login_id sum(c_tot) sum(g_tot)
----------- ----------- ------------

10          30           400
20          300          NULL
30          350          650

Is there any simple way to achieve this?. If so how?

Regards,

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Jun 29 2000 - 00:00:00 CDT

Original text of this message

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