In 1848–51, the First Schleswig War was fought between Denmark and Schleswig-Holstein. The war was about Schleswig, which both parties wanted.
The war itself was fought in three rather short rounds April-August 1848, April-July 1849 and July-December 1850, interrupted by two long ceasefire. The strength ratio changed. Denmark suffered defeat at Schleswig in 1848, but won the two other great battles of the war at Fredericia in 1849 and Isted in 1850. However, the war luck actually depended on foreign intervention.
In 1848 there was great enthusiasm for the Schleswig-Holstein case in Germany, and many German states sent troops. In 1849, the German support for the Schleswig Holstein was smaller, and in 1850 it was withdrawn. Conservative powers led by Russia sought to stop the trend of revolution.
In the end, the war was definitely settled by the great powers, and they did not give either side either way. Instead, they wanted to restore Denmark’s “main street”, Schleswig and Holstein.