Source - Economist, Nov 24, 2018: "The big, beautiful Wall"
We built a wall 550 miles long in 2006 (Secure Fence Act). It had a negligible (crossings down by 0.6%) effect on Mexican migration. See this NBER working paper for details - “Border Walls” by Treb Allen, Cauê de Casto Dobbin and Melanie Morten. A better solution is to reduce trading costs between Mexico and the US which will benefit both countries and reduce wage discrepancies which attract Mexican migrants in the first place.
From the article: "So what effect did the first 550 miles have? Not much, suggests an analysis by economists at Dartmouth and Stanford Universities. Arrests at the southern border dropped after the fence was built, but this cannot be attributed completely to the wall, since those years also saw a deep recession. Still, by using a confidential data source—the id cards issued by the Mexican government, through its consulate, to its citizens living as immigrants in America, many of them illegally—the economists have isolated the effect of the new fencing on migration flows. And they calculate that it reduced the number of Mexican citizens living in America by only 0.6%. Mexicans immigrate to America illegally because of the lure of high-paying jobs. Policies that increase wages in Mexico tend to drive down migration. Cross-border trade costs more than trade within America over the same distance due to tariffs and border delays. The authors simulate the effects of a 25% reduction in cross-border trade costs and find that migration would have shrunk more than under the Secure Fence Act (by an additional 34%). Yearly benefits for both uneducated and educated American workers would increase—by $59 per head and $81 per head, respectively."