Tuesday, March 29, 2016

Group Extract Query In Clarity

"SELECT srm.last_name ""Last Name"",
srm.first_name ""First Name"",
srm.unique_name ""Resource ID"",
srm.email ""Email Address"",
cmn.User_name ""UserName"",
CSG.Group_name,
Date "Extract Date"
FROM srm_resources srm
JOIN prj_resources prj
ON srm.id=prj.prid
JOIN odf_ca_resource odr
ON srm.id=odr.id
JOIN cmn_sec_users cmn
ON cmn.id=srm.user_id
JOIN CMN_SEC_USER_GROUPS CMG
ON cmn.id=CMG.user_id
Join CMN_SEC_GROUPS_V CSG
ON (CMG.GROUP_ID=CSG.id)
JOIN prj_obs_associations aso
ON aso.record_id = srm.id
JOIN obs_units_flat_by_mode mde
ON mde.linked_unit_id = aso.unit_id
WHERE mde.unit_mode ='OBS_UNIT_AND_CHILDREN'
AND mde.unit_id =5054143
AND aso.table_name ='SRM_RESOURCES'
and srm.is_active='1'
and CSG.LANGUAGE_CODE = 'en'"