I think you need to start with GROUP BY. You'll need something along this line:
select partno, month, sum(cost) from mytable group by partno, month; This ensures that you get one summary row showing the total cost of for each part number for each month. Naturally, you can add WHERE conditions to get only certain part numbers and only certain months. Rhino ----- Original Message ----- From: "Ed Reed" <[EMAIL PROTECTED]> To: <mysql@lists.mysql.com> Sent: Friday, July 29, 2005 4:31 PM Subject: Group Summary by Month I have a table that contains all the part number and cost transactions over time. I wanna get a get the summary cost of each part number for each month. For example, when I supply a single part number to this query the results should be something like this. +----------+----------+ | Month | Cost | +----------+----------+ | Oct 04 | 19521.00 | | Nov 04 | 854.00 | | Dec 04 | 191.00 | | Jan 05 | 7015.00 | | Feb 05 | 21.00 | | Mar 05 | 25.00 | | Apr 05 | 13571.00 | | May 05 | 1015.00 | +----------+----------+ Can anyone point me in a direction to start on this? -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.9.6/59 - Release Date: 27/07/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]