[DB-SIG] Help on this query

Titu Kim kimtitu@yahoo.com
Tue, 4 Jun 2002 17:43:31 -0700 (PDT)


Hi there,
    I have two unrelated tables A and B which store
different data. Let say the followings are the table
schemas,

Table A
ID  number,
Date number,
EarnA  number

Table B
ID  number,
Date number,
EarnB number

ID in Table A and Table B is the same data. Assume
Date in Table A and Table B is in number format. I can
get EarnA from Table A with this query

Select sum(EarnA) from TableA 
where ID=XX and Date between mmm and nnn;

Similar for TableB i can get EarnB 
Select sum(EarnA) from TableB
where ID=XX and Date between mmm and nnn;

The number of rows in TableA and TableB are different
and EarnA and EarnB are two different data. Now if i
want to show EarnA and EarnB in one query for the same
ID in both Tables, how can i do this? Table schemeas
are simplified for discussion purposes.

Thanks.


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com