• Still useful 2-years later! A couple of notes. If used in a longer queary the statement before WITH needs to end with a semi-colon (;). and the ROW_NUMBER statement needs open and closed parentheses after it ROW_NUMBER().:-)