A necessary and sufficient condition for uniqueness of the trivial solution in semilinear parabolic equations