Suppose discounted asset prices in a financial market are given by a
P
‐semimartingale
S
. Mean–variance hedging is the problem of approximating, with minimal mean‐squared error, a given payoff by the final value of a self‐financing trading strategy. Mean–variance portfolio selection consists of finding a self‐financing strategy whose final value has maximal mean and minimal variance. In both cases, this leads to projecting a random variable in
L
2
(
P
) onto a space of stochastic integrals of
S
, and, apart from proving closedness of that space, the main difficulty is to find more explicit descriptions of the optimal integrand. Both problems have a wide range of applications, and many examples and solution techniques can be found in the literature. Nevertheless, challenging open questions still remain.