How many joules are required to mine a unit of coal?
The efficiency of coal as a source of electricity is very low: typically of the order of 30%. So losses are of the order of 70%. But losses due to energy expended in the extraction of the coal itself only form a very small proportion of this.

Estimates for extractive losses tend to be of the order of 0.5-5%. That's a huge relative range, because the energy density of different types of coal (J/kg) can vary by a factor of 5; the coal could come from a deep mine or an open-cast; and the amount and kind of mechanisation varies hugely.

But these huge relative variations are completely swamped in absolute terms by the other losses, which are at the very best 20%, and can be 65% or so. Which is why there's not a huge amount of literature on the energy inputs to coal extraction: it's such a small part of total losses, that it gets lost in the rounding.

In the British residential electricity supply, there's about 7% losses from local distribution (UK figure), 2-3% from transmission grid, and about 60% losses at the plant itself, in the form of heat (NB efficiencies here are multiplicative, rather than additive). The British average for 2013 was 64.2% losses in plant - see DUKES 2014 table 5.9

CHP plants mitigate this by capturing a large share of the heat, for distribution in local heat grids. But they still have losses of 5-25% at the plant itself, and then further losses in the heat and electricity distribution system. Call it 20% losses in the best case. Denmark has a lot of high-efficiency coal plants and CHP, but still only managed 55% efficiency, so 45% losses (Danish Electricity Supply '08 Statistical Survey, Table 10).