He was the second best candidate for the job, but still got hired.
Idiomatic Expressions for second best
Phrase: second best to none
Meaning: almost as good as the best; very high quality
Usage: While she may not have won the competition, her performance was second best to none.