A SQL method for computing rolling totals without window functions