MySQL Forums
Forum List  »  Newbie

calculating a column´s value from two registries
Posted by: jx_50
Date: September 02, 2004 09:20AM

Hi, I have a table that looks like this:


Year|Month|Concept|amount
2003| 1 | 3 | 1596
2003| 2 | 4 | 2258
2004| 1 | 3 | 4563

This means that someone made a payment (different types of payment defined by the "concept" columns) in x month on y year. This table is the result of a query joining two tables (I joined them to print others columns that are not relevant to this question). Anyway, I now need a new column that shows the difference between a payment for each month and the same month in the previous year to be shown in this same table. Could anyone here help?

Thanks

Options: ReplyQuote


Subject
Written By
Posted
calculating a column´s value from two registries
September 02, 2004 09:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.