what's a pyrrhic loss?

Well, if it is a loss that is offset by staggering gains, I'd like one, please! I guess the theme song for the old TV show "The Beverly Hillbillies" describes that
(this is from memory, and may not be exact):
"Let me tell you all a story 'bout a man named Jed;
Poor mountaineer, barely kept his fam'ly fed;
And then one day, he was shootin' at some food,
And up through the ground come a-bubblin' crude---
Oil, that is. Black gold. Texas tea."
So--he lost his food, but gained an oil field.