Can someone explain the difference between rank and rownumber in Teradata? Also, what if there is a tie in rank?