• i m wondering, instead of using cursors, we could have used CTE...