quering for cumulative sum using join instead of correlated subquery