T-SQL: How To Write A Cross Apply and Why