Great Wall of China... Mongols. I rest my case.
Yeah, that worked real well.
Actually, it's a common misconception to think that the Great Wall was built as a military defense mechanism in the event of full scale war. For one, it's too low, easily scalable by an army with the right tools. And secondly, it's too long, and can never be effectively manned along the full length. All in all, the Great Wall was never designed to function like a city wall.
What the wall really does, and it does well, is act as a deterent and early warning mechanism against the annual and semi-annual small scale border raids from the northern nomadic tribes, where riders would just charge down south, loot what they can and quickly retreat back into the great prairies. It's actually a (relatively) economical answer to a persistent problem -- for it's very expensive for a settled agricutural civilization to mobilize an army, while it costs almost nothing for the nomads to gather up a group of riders and raid a small border settlement.
And BTW, China is far from the only one in building a wall. Almost every settled civilization on the Eurasian continent, from Korea all the way to England, built a wall at some point in their history. The Chinese wall was the largest simply because China face the greatest threat from the Mongolian plains, which produced some of the most brutal and effiecient nomadic people in human history.