We present a complete sample of molecular clumps containing compact and ultracompact HII (UC HII) regions between l=10{deg} and 60{deg} and |b|<1{deg}, identified by combining the APEX Telescope Large Area Survey of the Galaxy submm and CORNISH radio continuum surveys with visual examination of archival infrared data. Our sample is complete to optically thin, compact and UC HII regions driven by a zero-age main-sequence star of spectral type B0 or earlier embedded within a 1000M_{sun}_ clump. In total we identify 213 compact and UC HII regions, associated with 170 clumps. Unambiguous kinematic distances are derived for these clumps and used to estimate their masses and physical sizes, as well as the Lyman continuum fluxes and sizes of their embedded HII regions.