select oh2.oh_name as 'GROUP'
, oh2.oh_client as 'CLIENT'
, replace(oh1.oh_name,'/SAIF','') as 'USER'
, case USR_Active
when 0 then 'DEACTIVATED'
else ' '
end as STATE
, USR_LastSession as LAST_USED
from oh as oh1
,oh as oh2
,usr
,usrg
,USG
where oh1.oh_idnr=USR_OH_Idnr
and USRG_USR_Idnr=USR_OH_Idnr
and usrg_usg_idnr = usg_oh_idnr
and USG_OH_Idnr=oh2.oh_idnr
order by 1, 2, 3
------------------------------
Pete
------------------------------
Original Message:
Sent: 11-07-2019 05:59 PM
From: Lester Chew
Subject: SQL Query
Does someone have a MS SQL query to extract a list of users, the Automic group assigned to each of the user for a specific client or group by clients?