Hey there,
I can relate to your problem, as I have gone through the same feeling many times before. I gradually got over it. At first when our prof. sent us the results, I'd first check my "opponents'" grades, and then my own grade. If my grade was worse, I'd feel sick for some hours, then it'd gradually pass, but well it was a pretty weird feeling.
After I realized how weird what I was doing, I started checking my own grade only. I never asked others for their grades, I just cared about my own mark. If I needed to know where I am compared to the class in general, I'd just check the average.
But this didn't go as smooth as I explained. I always tended to check others' grades after mine the first few times, but I made it through. After some time as I let it go, I saw that I felt more confident next to my friends, and everything went back to normal.
Maybe you could use this little method I used
Have a great day!