MAX query -I ,wrong ans

i dont know ,what is wrong in this code,plz help

@nirajgusain5,
Corrected code, here.

thanks abhijeet for your help.