SELECT * 
  FROM
       (
       
       SELECT usr.user_id, usr.full_name, 0 AS pkg_count, pkg.pkg_name, pv.pkg_version, proj.proj_name, vt.vtree_name, rt.rtag_name, rt.rtag_id, pv.pv_id,
	          usr.user_email
         FROM package_versions pv,
              packages pkg,
              release_content rc,
              users usr,
              projects proj,
              vtrees vt,
              release_tags rt
        WHERE rc.pv_id = pv.pv_id
          AND rc.rtag_id = rt.rtag_id
          AND rt.vtree_id = vt.vtree_id
          AND vt.proj_id = proj.proj_id
          AND pv.pkg_id = pkg.pkg_id
          AND pv.modifier_id = usr.user_id
          AND TO_DATE( TO_CHAR( pv.modified_stamp,'DD-MON-YYYY HH24:MI:SS' ),'DD-MON-YYYY HH24:MI:SS' ) > TO_DATE( TO_CHAR( SYSDATE - 90,'DD-MON-YYYY HH24:MI:SS' ),'DD-MON-YYYY HH24:MI:SS' )
          AND pv.dlocked = 'N'  
          AND vt.hide = 'N'
          AND pv.pkg_version <> 'current_$USER'
          AND usr.user_id = :USER_ID

       UNION
       
       SELECT usr.user_id, usr.full_name, COUNT(usr.user_id) AS pkg_count, 
              NULL AS pkg_name, NULL AS pkg_version, NULL AS proj_name, NULL AS vtree_name, NULL AS rtag_name, TO_NUMBER(NULL) AS rtag_id, TO_NUMBER(NULL) AS pv_id,
			  usr.user_email
         FROM package_versions pv,
              release_content rc,
              users usr,
              vtrees vt,
              release_tags rt
        WHERE rc.pv_id = pv.pv_id
          AND rc.rtag_id = rt.rtag_id
          AND rt.vtree_id = vt.vtree_id
          AND pv.modifier_id = usr.user_id
          AND TO_DATE( TO_CHAR( pv.modified_stamp,'DD-MON-YYYY HH24:MI:SS' ),'DD-MON-YYYY HH24:MI:SS' ) > TO_DATE( TO_CHAR( SYSDATE - 90,'DD-MON-YYYY HH24:MI:SS' ),'DD-MON-YYYY HH24:MI:SS' )
          AND pv.dlocked = 'N'  
          AND vt.hide = 'N'
          AND pv.pkg_version <> 'current_$USER'
       GROUP BY  usr.user_id, usr.full_name, usr.user_email
	   
       ) wip
ORDER BY UPPER(wip.full_name), wip.pkg_count DESC, UPPER(wip.proj_name), UPPER(wip.vtree_name), UPPER(wip.rtag_id), UPPER(wip.pkg_name)     



