• Thank you Chris for your continue support. Probably I am not able to find a bug in the query but when I am saying :

    SELECT *

    FROM #Results

    WHERE student_name <> 'Default'

    which is not returning me the required output No. 3, same when I am saying :

    SELECT *

    FROM #Results

    WHERE student_name = 'Default'

    is not returning me the required output No. 2, while

    SELECT *

    FROM #Results

    is giving me the correct oupput of required output No. 1.

    I am really thankful to you for your valuable code which is simultaneously giving me the learning of SQL too (in which I am very much poor)

    Regards

    Girish Sharma