Parents are being warned against sending their children to the best-performing school in the neighbourhood if they want their children to do well.
Research from the London School of Economics shows they could be more confident and therefore successful if they came top of the class in a worse school which does not do so well in tests or exams.
The researchers, who looked at the performance of more than two million children, concluded that it was those who were ranked top of the class in their primary school that went on to do well in secondary school. Conversely, those who performed just as well but were ranked lower among their peers in higher-achieving primary schools were sometimes put off by their relatively low position in the class and failed to shine in their secondary school.
"Imagine two pupils of the same high ability: one is top of the class but the other is in the middle as the school they attend attracts more high-ability students," it says.
The research finds the pupil who was top of the class performs better in secondary school and is more confident.
The report adds: "Our results ... imply for individual parents that they should not always send their child to the best school if this would mean a lower ranking for their child in that school."
The researchers reveal that boys are more likely to get kudos and self-confidence from being top of the class - they are four times more likely to improve as a result of their ranking than girls.