(I will assume from your use of pounds that you are in the UK)
With normal Mortgages the interest isn't added as some lump sum at the beginning, it accrues gradually. So if you repay the mortgage early you will pay much less interest than if you let it go to term.
Obviously you will have paid some interest in the time you owned the property, but you will have also hopefully got the use of the property for that time instead of paying rent.
However in addition to interest there are likely to be various fees, both for taking out the mortgage in the first place and in some cases for repaying it early.
A house sale itself will also involve significant costs, estate agents fees (for the seller), solicitors fees (for both buyer and seller), search and survey costs (for the buyer) and (unless it is a very cheap house) stamp duty (for the buyer). So if you assume house prices will stay the same buying a house is only likely to be worthwhile if you plan to keep it for a significant number of years.
On the other hand house prices in the UK have historically risen faster than inflation, we are a relatively small island with a lot of restritions on development.