sql_language thread: Compare values in two tables.
SELECT Product, TotalPrice FROM Table1 T1 WHERE T1.TotalPrice <> (SELECT SUM(Price) FROM Table2 WHERE T1.Product=Table2.Product); -- Jeff Mason Custom Apps, Inc. Jeff@c... -----Original Message----- From: Gowri Shankar [mailto:shankargo@y...] Sent: Thursday, October 24, 2002 1:43 PM To: sql language Subject: [sql_language] Compare values in two tables. Hi, I have two tables Table1 :- Product TotalPrice ------------------- Shoe 6000 Camera 8000 Musicsys. 25000 Table2 :- Product Price Brand ------------------------ Shoe 3000 Nike Shoe 2000 Addidas Camera 4000 Canon Camera 4000 Nikon Musicsys. 15000 Sony Musicsys. 9000 Philips I need to compare the 'total price' of Product in table1 with sum of price of respective product in table 2 and if there is any difference and report it. the output should be Product TotalPrice ------------------- Shoe 6000 Musicsys. 25000 Regards, Shankar __________________________________________________ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/
|





