Re: select data from two tables and SUM qty of the same ID

2010-11-10 Thread haidarpesebe
Thanks a lot. We will try and inform you. --Original Message-- From: Aveek Misra To: Albahar Uya Cc: MySQL Lists Subject: Re: select data from two tables and SUM qty of the same ID Sent: Nov 10, 2010 17:38 SELECT product.ID, product.ProductName, product.ISBN, SUM(salesreport.QTY

Re: select data from two tables and SUM qty of the same ID

2010-11-10 Thread Aveek Misra
SELECT product.ID, product.ProductName, product.ISBN, SUM(salesreport.QTY) as Total_Quantity FROM salesreport, product WHERE product.ID = salesreport.ID GROUP BY salesreport.ID ORDER BY Total_Quantity DESC; On Nov 10, 2010, at 3:53 PM, HaidarPesebe wrote: please help us look for the data

select data from two tables and SUM qty of the same ID

2010-11-10 Thread HaidarPesebe
please help us look for the data select from two tables with the following details: Primary table: product ID | ProductName | ISBN | --- 1 | Product A | 123 | 2 | Product B | 456 | 3 | product C | 444 | --- second table:

Re: select data from two tables and SUM qty of the same ID

2010-11-10 Thread HaidarPesebe
list' Note: product_id (product) = bid (sales_report) haidarpesebe - Original Message - From: Aveek Misra ave...@yahoo-inc.com To: HaidarPesebe haidarpes...@gmail.com Cc: MySQL Lists mysql@lists.mysql.com Sent: Wednesday, November 10, 2010 5:38 PM Subject: Re: select data from two tables

Re: select data from two tables and SUM qty of the same ID

2010-11-10 Thread HaidarPesebe
: Aveek Misra ave...@yahoo-inc.com To: HaidarPesebe haidarpes...@gmail.com Cc: MySQL Lists mysql@lists.mysql.com Sent: Wednesday, November 10, 2010 5:38 PM Subject: Re: select data from two tables and SUM qty of the same ID SELECT product.ID, product.ProductName, product.ISBN, SUM(salesreport.QTY