T-SQL Travel Puzzle