Posted - 07/15/2013 : 21:53:17
| In Java application development, ordered or cross-row computation based on database is oftenly involved, such as the last three, the previous one of the current record, the top five, the last but one, and the ranking of a certain record.
For instance,to find out the monthly growth rate of contract values for each sales man in 2012 in a Contract table. We need to firstly group by salesman, group by year within each group, group by month for each year and summarize, and lastly, perform the inter-row computation between the current month and its previous month.
With esProc script, it can be written as bellow:
And what do you think of such solution?
Are there any better ways to deal with it with SQL or Oracle?
BI technology consultant for Raqsoft
10 + years of experience on BI/OLAP application, statistical computing and analytics