The following provides a solution to the original post question. There are other approaches that may work as well or better. Specifically, you should check out the following alternate solutions:
Determining average recovery using SQL commands posted…