i have two tables
table pants
id amt
1 50
1 50
1 50
table jacket
id amt
1 50
1 50
1 50
when i do a select of say
SELECT a.id, b.id SUM(a.amt),sum(b.amt) from pants a, jacket b WHERE A.ID = B.ID group by a.id, b.id
/* i get a really awkaward result i can't understand what im doing wrong*/
i would like to get just one line with the result set
a b a.mt b.amt
1 1 150 150
but instead my amounts get duplicate like 3 or four times. like 450 and 450 ????
I have tried using DISTINCT on the sql but i have gotten no where can anyone throw me a bone here.
Thanks in advance.