SELECT DISTINCT
       :RTAG_ID,
       qry.pv_id
 FROM (
       SELECT dep.*,
       LEVEL AS LEVEL_NUM
       FROM package_dependencies dep
       START WITH dep.dpv_id IN ( :PV_ID )
       CONNECT BY PRIOR dep.pv_id = dep.dpv_id
      ) qry,
       packages pkg,
       package_versions pv,
       release_content rc
 WHERE qry.dpv_id = pv.pv_id
   AND pv.pkg_id = pkg.pkg_id
   AND rc.pv_id = qry.pv_id
   AND rc.rtag_id = :RTAG_ID
