Fixed a bug in the sql where the max wasn't getting partitioned over subjet id in the coded table