/* Multi Role Members */
SELECT DECODE ( usr.IS_ONLINE,
	   		  	NULL, NULL,
				'<img src="images/i_online.gif" title="User is online at '|| usr.ONLINE_AT  ||'" width="16" height="16" border="0" hspace="2">' ) AS user_online,
	   DECODE ( usr.IS_DISABLED,
	   		  	NULL, 'LIMG_USER',
				'LIMG_USER_DISABLED' ) AS user_image,
	   usr.user_id,
	   usr.full_name,
	   usr.USER_EMAIL,
	   usr.USER_NAME,
	   usr.DOMAIN,
	   usr.LAST_REQUEST
  FROM (
		SELECT ur.USER_ID, COUNT(ur.USER_ID) AS ROLE_SUM 
		  FROM USER_ROLES ur
		 WHERE ur.ROLE_ID IN (
		 	   			  	  SELECT *
					   	        FROM THE ( SELECT CAST( IN_LIST_NUMBER( :ROLE_ID_LIST ) AS ACCMGR_NUMBER_TAB_t ) FROM dual )  
		 	   			  	  )
		GROUP BY ur.USER_ID
		) qry,
		USERS usr	
 WHERE qry.ROLE_SUM = :ROLE_SUM		
   AND qry.USER_ID = usr.USER_ID  
  
ORDER BY UPPER(usr.FULL_NAME)