• Got it wrong.

    I thought that there would be an error because the StudentId column has the alias "StudentNumber" inside the subquery and in line 25 it's being declared as StudentId again.

    Interesting behaviour. Learned something new. 🙂

    Thank you for the question.

    Best regards,

    Best regards,

    Andre Guerreiro Neto

    Database Analyst
    http://www.softplan.com.br
    MCITPx1/MCTSx2/MCSE/MCSA