/* Release Package Versions */
SELECT rc.rtag_id,
  pv.PV_ID,
  pv.PKG_ID,
  pv.PKG_VERSION,
  DECODE ( pv.pv_id, :COMPARE_PV_ID, 'selected', NULL ) AS selected,
  rt.RTAG_NAME,
  p.PROJ_NAME,
  p.PROJ_NAME || ' | ' || rt.RTAG_NAME || ' | ' || pv.PKG_VERSION as text
FROM RELEASE_CONTENT rc,
  package_versions pv,
  RELEASE_TAGS rt,
  PROJECTS p
WHERE rc.pv_id                       = pv.PV_ID
AND pv.pkg_id                        = :PKG_ID
AND NVL( pv.v_ext, '|LINK_A_NULL|' ) = NVL( :V_EXT, '|LINK_A_NULL|')
AND rt.RTAG_ID                       = rc.rtag_id
AND rt.PROJ_ID                       = p.PROJ_ID
order by UPPER(PROJ_NAME) , Upper(RTAG_NAME)

