We present the results from a search for gravitational-wave transients associated with core-collapse supernovae observed within a source distance of approximately 20 Mpc during the first and second observing runs of Advanced LIGO and Advanced Virgo. No significant gravitational-wave candidate was detected. We report the detection efficiencies as a function of the distance for waveforms derived from multidimensional numerical simulations and phenomenological extreme emission models. For neutrino-driven explosions the distance at which we reach 50% detection efficiency is approaching 5 kpc, and for magnetorotationally-driven explosions is up to 54 kpc. However, waveforms for extreme emission models are detectable up to 28 Mpc. For the first t...