I HAV 2 TABLES
A B
A1 A2 B1
B2
ABC 120 ABC
87
DHD 32 FJD
78
DSA 31 ABC
5
KIU 54 FER
65
DSD 87 GFD
54
UJK 56 ABC
65
CONSIDER 'ABC' IN COLUMN A1 . NOTE THE CORRESPONDING VALUE IN A2 ie
120
NOW FIND THE SUM OF ALL VALUES IN B2 WHERE B1 = ABC
ie 120 AND (87 + 5 + 65)=157
120 IS NOT EQUAL TO 157
I WANT TO FIND ALL SUCH RECORDS FROM TABLE A
HOW DO I DO IT
SOMEBODY PLZ HELP ME!!!!!!!
ITS URGENT
sangram.0149@gmail.com - 17 Mar 2006 14:39 GMT
PLZ NOTE: COLUMN B2 IS SHIFTED BETWEEN A1 AND A2.IT SHOULD BE TO THE
TRIGHT OF B1
Brian Tkatch - 17 Mar 2006 17:32 GMT
SELECT SUM(B2) FROM B WHERE B1 = ?
Please do not type in all caps. It is considered rude, as one yelling.
If you do not have the ability to typed in mixed case, please state
that in your message.
B.
sangram.0149@gmail.com - 20 Mar 2006 07:10 GMT
I DONT CARE
Knut Stolze - 20 Mar 2006 10:42 GMT
> I DONT CARE
It would really be polite to honor Brian's request if he is already helping
you with your exercises and homework.

Signature
Knut Stolze
DB2 Information Integration Development
IBM Germany
sangram.0149@gmail.com - 20 Mar 2006 10:59 GMT
I get ur point,Sir
but Mr Brian himself could have been a little polite,
or may be, I misread his tone.
-
Sangram
Brian Tkatch - 20 Mar 2006 14:59 GMT
>but Mr Brian himself could have been a little polite,
>or may be, I misread his tone.
I thought i was polite.
First i answered your question.
Afterwards i made a request. Is there a better way to do that?
B.
sangram.0149@gmail.com - 21 Mar 2006 07:10 GMT
In that case ,Sir
I apologise.Wen u said "please state that in your message ", I thought
u were tryin to get at me.
kindly accept my apologies
regards,
Sangram
Brian Tkatch - 21 Mar 2006 15:41 GMT
OK, i see. I'll bear that in mind for the future. :)
B.
Tonkuma - 17 Mar 2006 22:26 GMT
SELECT A1, A2, SUMB2
FROM A
INNER JOIN
(SELECT B1
, SUM(B2) SUMB2
FROM B
GROUP BY B1
) BS
ON A.A1 = B.B1
AND A.A2 <> BS.SUMB2