I personally think that unneccessarily comparing oneself to others is one of the main sources of people's unhappiness. However, I never manage to make up my mind in wondering if on some occasions it is a necessary tool for motivation to change oneself. It's probably about the reasons we have for comparing ourselves as well as the grounds on which we base our comparisons (i.e. if it is things we can change or not).
Regarding things we can not change I found some nice quotes (as usual I apologize for my rather crude translation, it's not so poetic but I still hope it catches the essence).
The first one is by Abbas Paphnutios
"An welchen Ort du auch hinkommst,
vergleiche dich nicht mit anderen
und du wirst Ruhe finden."
[Wherever place you go to,
do not compare yourself to others
and you will find peace]
The other one is by Charles de Montesquieu
"Wenn man nur glücklich sein wollte, wäre es ja bald getan:
aber man will ja glücklicher als die anderen sein,
und das ist fast immer schwierig,
weil wir die anderen für glücklicher halten,
als sie wirklich sind."
[If one only wanted to be happy, it would be an easy task:
but one always wants to be more happy than others,
and this is quite difficult
as we tend to take the others for happier
than they really are.]
Both I think point out a spectrum of thought which I find thrilling and worth to be tried in real life. Happy experimenting!